feat(authentication): add OAuth sign-in-only mode - #1597
Open
kkopanidis wants to merge 3 commits into
Open
Conversation
Allow OAuth init and token routes to request signIn or both (default). Sign-in-only blocks new user creation so clients can collect terms and profile data before registration.
Request mode remains a per-call UX switch. Provider allowRegistration (default true) is the policy ceiling so clients cannot force account creation when registration is disabled.
This reverts commit a114494.
kkopanidis
marked this pull request as ready for review
September 10, 2026 12:06
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.
Description
Backport of OAuth
mode(signIn|both, defaultboth) from 0.17 so clients can start OAuth as sign-in only.Same API contract as #1596 (
main):GET /init/:providerandGET /initNative/:providerstoremodeon the state tokenhookandPOST /native/:providerread it from statePOST /google,POST /facebook) acceptmodein the bodyThis is a client-controlled UX switch, not a security boundary. When
mode=signInand no matching user exists, the request fails withREGISTRATION_NOT_ALLOWED(403). Existing-user login and account linking still work. Anonymous-user conversion is treated as registration and is blocked in sign-in-only mode.Type of change
How Has This Been Tested?
resolveOAuthModeandassertOAuthRegistrationAllowed