Update OAuth2-Backend-Approach.md

This commit is contained in:
Ste Vaidis 2025-01-08 10:30:07 +02:00
parent c0e47399d5
commit 0bd891b080

View File

@ -213,7 +213,7 @@ curl -X GET "https://www.googleapis.com/oauth2/v3/userinfo" \
-H "Accept: application/json" -H "Accept: application/json"
``` ```
### 3. Google **response** to Back with profile data ### 3. Google **response** to Backend with profile data
``` ```
{ {
@ -239,6 +239,7 @@ curl -X GET "https://www.googleapis.com/oauth2/v3/userinfo" \
"email": "john.doe@example.com", "email": "john.doe@example.com",
} }
``` ```
<br><br><br>
### Frontend Dashboard Code ### Frontend Dashboard Code
@ -296,11 +297,13 @@ function DashboardPage() {
} }
``` ```
<br><br><br>
### Backend Dashboard ### Backend Dashboard
If the token is valid send the data. If the frontend token is valid, the backend will response to the request.
If the token is not valid: If the frontend token is **not** valid, the backend will:
1. Get new tokens using refresh token 1. Get new tokens using refresh token
2. Set new cookie with new access token 2. Set new cookie with new access token