Branch: feat/123-add-oauth-google-login
Base: main
Template: .github/pull_request_template.md
This PR adds Google OAuth 2.0 login support to the authentication system, allowing users to sign in using their Google account as an alternative to email/password. It integrates the passport-google-oauth20 strategy and adds the necessary callback routes and session handling.
Added
src/auth/google.strategy.ts— Passport Google OAuth strategy configurationsrc/auth/oauth.controller.ts— OAuth callback and redirect route handlerstests/auth/google.strategy.spec.ts— Unit tests for the OAuth strategy
Modified
src/auth/auth.module.ts— Registered Google strategy in the auth modulesrc/config/env.config.ts— AddedGOOGLE_CLIENT_IDandGOOGLE_CLIENT_SECRETenv varsREADME.md— Added OAuth setup instructions
Users were dropping off during signup due to the friction of email/password registration. Adding Google OAuth reduces signup time to a single click and improves conversion. Closes #123.
- Unit tests
- Integration tests
- Manual testing
Manually tested the full OAuth flow in local environment — Google consent screen, callback redirect, session creation, and user profile persistence. Unit tests cover the strategy configuration and token validation.
No breaking changes. Existing email/password login is unaffected.
- This PR introduces breaking changes
Closes #123
- My code follows the project style guidelines
- I have performed a self-review of my code
- I have commented my code where necessary
- I have added tests that prove my fix/feature works
- New and existing tests pass locally
- I have updated documentation if needed
Key files to review: src/auth/google.strategy.ts, src/auth/oauth.controller.ts