Skip to content

Add OAuth login with Google and Discord - #1469

Open
drusepth wants to merge 6 commits into
tailwind-redesignfrom
claude/oauth-login-account-creation-fj362n
Open

Add OAuth login with Google and Discord#1469
drusepth wants to merge 6 commits into
tailwind-redesignfrom
claude/oauth-login-account-creation-fj362n

Conversation

@drusepth

Copy link
Copy Markdown
Member

Fixes #

Changes proposed:

  • Add OAuth authentication support for Google and Discord login/signup via Devise OmniAuth
  • Implement User.from_omniauth() to handle account creation and linking for OAuth users
  • Create UserAuthentication model to track linked OAuth provider accounts per user
  • Add OmniauthCallbacksController to handle OAuth callbacks, account linking, and new user onboarding
  • Add UserAuthenticationsController to allow users to disconnect linked provider accounts
  • Implement UserOnboardingService to consolidate post-signup logic (contributor invite linking, referral tracking) shared by both traditional and OAuth signup flows
  • Add UI components for OAuth buttons on login/signup pages and connected accounts management on account settings
  • Add password_automatically_set flag to track OAuth-only users who haven't set a real password yet
  • Prevent OAuth-only users from disconnecting their last linked provider until they set a password
  • Support case-insensitive email matching when linking OAuth accounts to existing users
  • Add comprehensive test coverage for OAuth flows, account linking, and provider disconnection

@indentlabs/contributors

https://claude.ai/code/session_01U8MsJprHoGKuQXuJ5SvJgN

claude added 6 commits August 17, 2026 01:37
Users can link multiple OAuth providers (Google, Discord) to one account.
Also adds users.password_automatically_set to track accounts created via
OAuth that have never chosen their own password, and User.from_omniauth
to resolve an OmniAuth callback to a linked, email-matched, or new user.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U8MsJprHoGKuQXuJ5SvJgN
Adds the omniauth gems (with CSRF protection), Devise provider config
driven by env vars, callback + disconnect controllers, and extracts the
post-signup contributor-invite and referral logic from
RegistrationsController into UserOnboardingService so OAuth signups get
the same onboarding as email/password signups.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U8MsJprHoGKuQXuJ5SvJgN
Branded Google/Discord buttons (shown only when provider credentials are
configured) on the login and signup pages, and a Connected Accounts card
on the More Settings page for linking/disconnecting providers. Users who
signed up via OAuth and never set a password can't disconnect their last
linked provider until they set one.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U8MsJprHoGKuQXuJ5SvJgN
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U8MsJprHoGKuQXuJ5SvJgN
previously_new_record? is reset by after_create hooks that update the
user row again (initialize_secure_code), so OAuth signups were never
running onboarding; track creation explicitly via User#new_oauth_signup.

Also fixes a latent bug carried over from RegistrationsController: the
contributor-invite relation was queried with user_id: nil, then
update_all set user_id, so the notification loop re-ran the query and
found nothing. Materialize the records before updating.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U8MsJprHoGKuQXuJ5SvJgN
@drusepth
drusepth force-pushed the claude/oauth-login-account-creation-fj362n branch from 04408f7 to ec9d20b Compare August 17, 2026 01:43
@drusepth
drusepth changed the base branch from master to tailwind-redesign August 17, 2026 01:43
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.

2 participants