gatsbyjs/gatsby
View on GitHubSSR: Restricting Access to Specific Pages Based on Authenticated User
Open
#36427 opened on Aug 20, 2022
help wantednot staletype: documentation
Description
Preliminary Checks
- This issue is not a duplicate. Before opening a new issue, please search existing issues: https://github.com/gatsbyjs/gatsby/issues
- This issue is not a question, feature request, RFC, or anything other than a bug report. Please post those things in GitHub Discussions: https://github.com/gatsbyjs/gatsby/discussions
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:
- A page and related static images that are fully public (no authentication required) - eg. a login page
- A page and related static images that are accessible only to any logged-in user - eg. an index page
- A page and related static images that are accessible only to any admin user - eg. an admin dashboard page
Further background information / motivation:
- https://github.com/gatsbyjs/gatsby/issues/1100#issuecomment-576655633
- https://github.com/gatsbyjs/gatsby/discussions/32479
Steps to Resolve this Issue
- Look for a guide for authentication / authorization for SSR in the Gatsby docs
- Fail in finding such a guide