2.6.4.1 OAuth2 Flow
1. Frontend: User selects “Sign in with Google.”
2. Redirect to Google’s OAuth2 endpoint with your client ID and scopes.
3. Callback: Google redirects back to your specified endpoint with a code.
4. Backend: Exchanges code for tokens, then retrieves user info (email, name).
5. Account Linking: If the user’s email already exists, log them in; otherwise, create a new user record.
Example (Node.js + passport-google-oauth20 or custom logic):
Last updated