Skip to content

Feat/google_oauth#145

Merged
nafiuishaaq merged 3 commits intoMentoNest:mainfrom
Mkalbani:feat/google_oauth
Jan 24, 2026
Merged

Feat/google_oauth#145
nafiuishaaq merged 3 commits intoMentoNest:mainfrom
Mkalbani:feat/google_oauth

Conversation

@Mkalbani
Copy link
Contributor

closes #122

Google OAuth 2.0 Authentication

Implement Google OAuth 2.0 login with extensible provider structure for future integrations (GitHub, Facebook).

Changes:

  • Install passport-google-oauth20, @nestjs/passport, passport, @nestjs/jwt, passport-jwt
  • Configure GoogleStrategy with client credentials via environment variables
  • Routes: GET /auth/google and GET /auth/google/callback
  • Add authProvider enum field to User entity ('local' | 'google' | 'github')
  • User service links Google ID to existing users by email or creates new users with profile data
  • AuthService issues JWT token on successful authentication
  • Modular design allows easy addition of GitHub, Facebook providers

Testing:

  • Google login redirects and returns JWT token + user data
  • Returning users linked by email; first-time users created with Google profile
  • Both flows tested and functional

@nafiuishaaq nafiuishaaq merged commit 3238ec0 into MentoNest:main Jan 24, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

XX 7: Implement Gmail (Google OAuth) and social login

2 participants