feat(auth): add Google OAuth2 login (#292)#443
Merged
LaGodxy merged 5 commits intoApr 26, 2026
Conversation
- Add GoogleStrategy using passport-google-oauth20 - Add GoogleAuthGuard wrapping passport 'google' strategy - Add /auth/google and /auth/google/callback endpoints - Add googleOAuthLogin to AuthService with account linking and profile sync - Make User.password optional to support OAuth-only accounts - Add googleId unique field to User model - Add migration for schema changes - Update AuthModule with PassportModule and GoogleStrategy - Add GOOGLE_CLIENT_ID/SECRET/CALLBACK_URL to .env.example
|
@deborahamoni0-prog Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Contributor
Author
|
done |
LaGodxy
approved these changes
Apr 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #292
Summary
Implements Google OAuth2 authentication as described in issue #292.
Acceptance Criteria
GET /auth/google→ redirect,GET /auth/google/callback→ tokens)Changes
passport-google-oauth20, extractsgoogleId,email,firstName,lastName,avatarfrom Google profileAuthGuard('google')GET /auth/google(redirect) andGET /auth/google/callback(returns access + refresh tokens)User.passwordmade optional,googleIdunique field added20260422000001_add_google_oauth@nestjs/passport@10.0.3,passport-google-oauth20@2.0.0Config
Add to
.env:Verified
npm run lint— 0 errorsnpm run build— passesnpm test— 9/9 tests pass