gatsbyjs/gatsby

SSR: Restricting Access to Specific Pages Based on Authenticated User

Open

#36 427 ouverte le 20 août 2022

Voir sur GitHub
 (7 commentaires) (2 réactions) (0 assignés)JavaScript (55 950 stars) (10 198 forks)batch import
help wantednot staletype: documentation

Description

Preliminary Checks

Summary

@KyleAMathews asked for this issue: https://github.com/gatsbyjs/gatsby/issues/1100#issuecomment-1221020314


A guide about how to perform simple authentication and authorization in Server-Side Rendering (SSR) using getServerData would be great!

I would suggest that it include the following:

  1. A page and related static images that are fully public (no authentication required) - eg. a login page
  2. A page and related static images that are accessible only to any logged-in user - eg. an index page
  3. A page and related static images that are accessible only to any admin user - eg. an admin dashboard page

Further background information / motivation:

Steps to Resolve this Issue

  1. Look for a guide for authentication / authorization for SSR in the Gatsby docs
  2. Fail in finding such a guide

Guide contributeur