Skip to content

feat(authentication): add OAuth sign-in-only mode - #1597

Open
kkopanidis wants to merge 3 commits into
v0.16.xfrom
cursor/oauth-signin-mode-016-af9f
Open

feat(authentication): add OAuth sign-in-only mode#1597
kkopanidis wants to merge 3 commits into
v0.16.xfrom
cursor/oauth-signin-mode-016-af9f

Conversation

@kkopanidis

@kkopanidis kkopanidis commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Description

Backport of OAuth mode (signIn | both, default both) from 0.17 so clients can start OAuth as sign-in only.

Same API contract as #1596 (main):

  • GET /init/:provider and GET /initNative/:provider store mode on the state token
  • Redirect hook and POST /native/:provider read it from state
  • Direct token routes (POST /google, POST /facebook) accept mode in the body

This is a client-controlled UX switch, not a security boundary. When mode=signIn and no matching user exists, the request fails with REGISTRATION_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

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

  • Unit tests for resolveOAuthMode and assertOAuthRegistrationAllowed
Open in Web Open in Cursor 

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.
@kkopanidis
kkopanidis marked this pull request as ready for review September 10, 2026 12:06
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