diff --git a/OAuth2-Backend-Approach.md b/OAuth2-Backend-Approach.md index 23a7ad7..f342b00 100644 --- a/OAuth2-Backend-Approach.md +++ b/OAuth2-Backend-Approach.md @@ -114,19 +114,20 @@ redirect_uri=https://xorismesiti.gr/callback
+

Backend code



-

Implements the endpoint /auth/google/callback

-
- + Implements the endpoint /auth/google/callback

+

1. Recieves authorization code from Google


+

2. POST send the authorization code to https://oauth2.googleapis.com/token


+

3. POST response the access & refresh tokens


+

4. Respond the Fronend initial request with a cookie contains the access token


+
+

+ ```js // Backend callback URL: http://localhost:3000/auth/google/callback app.get('/auth/google/callback', async (req, res) => {