Skip to content

Multi Provider OAuth Integration #1082

Description

@Dhirenderchoudhary

Summary

Add OAuth login for Discord, Google, LinkedIn, GitHub — extends existing session-based auth. No Passport.js (conflicts with existing UserSessionService + breaks Controller→Service→Repo pattern).

Tech spec: https://www.notion.so/oauth-techspec-358aea5e3e0c80ba98cbf360959558a2

Scope

  • OAuth utility layer: generate auth URL + exchange code → normalised profile (id, email, username, avatar). CSRF state param via cookie.
  • User model: add discordId, googleId, linkedinId, githubId, authProvider enum. OAuth users get random UUID password.
  • AuthService: processOAuthCallback(provider, code) — lookup by provider ID → email → else create user. Block if is_deleted.
  • Controllers/Routes: replace Discord-only controllers/routes with generic GET /api/auth/:provider and /:provider/callback.
  • MFA: check mfaEnabled on callback, route to existing MFA flow if enabled.

Env vars needed

GOOGLE_CLIENT_ID/SECRET/REDIRECT_URI, LINKEDIN_CLIENT_ID/SECRET/REDIRECT_URI, GITHUB_CLIENT_ID/SECRET/REDIRECT_URI

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions