Add OAuth login with Google and Discord - #1469
Open
drusepth wants to merge 6 commits into
Open
Conversation
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
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
force-pushed
the
claude/oauth-login-account-creation-fj362n
branch
from
August 17, 2026 01:43
04408f7 to
ec9d20b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #
Changes proposed:
User.from_omniauth()to handle account creation and linking for OAuth usersUserAuthenticationmodel to track linked OAuth provider accounts per userOmniauthCallbacksControllerto handle OAuth callbacks, account linking, and new user onboardingUserAuthenticationsControllerto allow users to disconnect linked provider accountsUserOnboardingServiceto consolidate post-signup logic (contributor invite linking, referral tracking) shared by both traditional and OAuth signup flowspassword_automatically_setflag to track OAuth-only users who haven't set a real password yet@indentlabs/contributors
https://claude.ai/code/session_01U8MsJprHoGKuQXuJ5SvJgN