fix(oauth): auto-bind verified external login to existing active user by email - #1613
Open
renich wants to merge 2 commits into
Open
fix(oauth): auto-bind verified external login to existing active user by email#1613renich wants to merge 2 commits into
renich wants to merge 2 commits into
Conversation
… by email When an external OAuth connector returns a verified email address that matches an existing active user account in Answer, the previous implementation immediately aborted with UserAccessDenied (50x Access denied). This required users who had previously registered with password to log in first and manually bind the provider under user settings. For open communities and seamless SSO onboarding, auto-bind the external identity to the existing active user when the email matches, update their last login timestamp, and issue an access token directly. Co-developed with Antigravity AI (Google DeepMind) for root cause analysis and patch generation. Signed-off-by: Rénich Bon Ćirić <renich@evalinux.com> Co-authored-by: Antigravity <antigravity@google.com>
renich
force-pushed
the
fix/oauth-auto-bind-existing-user
branch
from
September 13, 2026 16:01
a26cbd5 to
2ee3902
Compare
When an external OAuth provider does not return a verified email address, the user is prompted to enter their email. If the email belongs to an existing user, Answer requests user confirmation (must: true). Previously, when must: true was received, ExternalLoginBindingUserSendEmail hit a duplicate `else if exist` branch that immediately returned EmailExistAndMustBeConfirmed without sending the binding confirmation email. Allow the flow to proceed when must: true: cache the external login info for the existing user and dispatch the verification email with the binding token. Upon email confirmation, ExternalLoginBindingUser binds the provider to the existing account. Co-developed with Antigravity AI (Google DeepMind) for root cause analysis and patch generation. Signed-off-by: Rénich Bon Ćirić <renich@evalinux.com> Co-authored-by: Antigravity <antigravity@google.com> Signed-off-by: Rénich Bon Ćirić <renich@evalinux.com>
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.
Proposed Changes
UserAccessDenied(/50x?title=Access%20denied&msg=Access%20denied).last_login_datefor the existing user.EmailStatusToBeVerified.Motivation & Context
Previously, if a user had registered using email/password (or was created during initial site setup), and subsequently attempted to log in using an OAuth connector (e.g., "Continue with Google"), Apache Answer aborted in
ExternalLogin:This redirected users to
/50x?title=Access%20denied&msg=Access%20denied, requiring them to realize they had to log in with their password first, navigate toSettings -> Account, and manually link the third-party provider.For non-technical communities and modern SSO expectations, this creates friction and confusion. Connectors already verify email ownership (for example,
connector-googlechecksrespGoogleAuthUserInfo.EmailVerifiedbefore settinguserInfo.Email). Automatically binding verified OAuth emails to existing active accounts provides a seamless single sign-on experience.Co-authored with Antigravity AI (Google DeepMind).