gatsbyjs/gatsby

SSR: Restricting Access to Specific Pages Based on Authenticated User

Open

#36,427 创建于 2022年8月20日

在 GitHub 查看
 (7 评论) (2 反应) (0 负责人)JavaScript (55,950 star) (10,198 fork)batch import
help wantednot staletype: documentation

描述

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

贡献者指南