File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
fern/products/docs/pages/authentication Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change 1+ ``` mermaid
2+ sequenceDiagram
3+ participant U as User
4+ participant F as Fern Docs
5+ participant A as OAuth2 Provider
6+
7+ U->>F: Visit restricted page
8+ F->>F: Check fern_token cookie
9+
10+ alt Cookie exists
11+ F->>F: Decode cookie
12+ F->>F: Verify authentication credentials
13+ Note over F: Attempt to refresh the token, if expired
14+
15+ alt User is properly authenticated
16+ F->>U: Show restricted content
17+ else User is not properly authenticated
18+ F->>U: User is shown a 404 page
19+ end
20+ else No cookie
21+ F->>A: Redirect to `/authenticate` endpoint
22+ A->>U: User authenticates
23+ U->>F: Authorization code is returned
24+ F->>A: Redirect to `/token` endpoint
25+ A->>A: Validate token request
26+ A->>F: Send authenticated access token
27+ F->>F: Set fern_token cookie
28+ F->>F: Verify authentication credentials
29+ F->>U: Show restricted content
30+ end
31+ ```
32+
You can’t perform that action at this time.
0 commit comments