gatsbyjs/gatsby

SSR: Restricting Access to Specific Pages Based on Authenticated User

開放

#36,427 建立於 2022年8月20日

 (7 則留言) (2 個反應) (0 位負責人)JavaScript (10,198 個分叉)batch import
help wantednot staletype: documentation

倉庫指標

星標
 (55,950 顆星)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

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

貢獻者指南