Skip to content

feat : Implement OAuth #9

Description

@Krishna-kg732

Implement OAuth Authentication

Add OAuth-based login (e.g., Google/GitHub) to enable users to sign in without creating credentials.

Scope:

  • Integrate OAuth 2.0 (Authorization Code Flow)
  • Add backend routes for login and callback
  • Fetch user profile and create/link user in DB
  • Issue session (JWT/cookie) after successful auth
  • Add frontend “Continue with …” button

Acceptance Criteria:

User can log in via OAuth
New users are auto-created
Existing users are correctly linked
Session persists and logout works

Checklist

  • Set up OAuth app (Google/GitHub) and obtain client ID/secret
  • Configure redirect/callback URL
  • Implement /auth/login (redirect to provider)
  • Implement /auth/callback (handle code → token exchange)
  • Fetch user profile from provider
  • Create or link user in database
  • Add OAuth fields (provider, provider_id, etc.)
  • Generate session (JWT/cookie) after login
  • Add frontend “Continue with …” button
  • Handle success + error states in UI
  • Implement logout flow
  • Secure secrets via environment variables
  • Validate state parameter (CSRF protection)
  • Test full auth flow end-to-end

/good first

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions