Skip to content

feat(api): allow signup without creating a session (#2586) - #2700

Open
YadneshTeli wants to merge 2 commits into
supabase:masterfrom
YadneshTeli:feat/signup-create-session
Open

feat(api): allow signup without creating a session (#2586)#2700
YadneshTeli wants to merge 2 commits into
supabase:masterfrom
YadneshTeli:feat/signup-create-session

Conversation

@YadneshTeli

@YadneshTeli YadneshTeli commented Aug 15, 2026

Copy link
Copy Markdown

What kind of change does this PR introduce?

Feature.

Resolves #2586 (and relates to supabase/supabase-flutter#1063).

What is the current behavior?

Today the POST /signup endpoint creates and returns a session whenever the user is auto-confirmed (or when confirmation is disabled project-wide). A session is only omitted when email/phone confirmation is required.

Client applications reacting to AuthChangeEvent.SIGNED_IN or needing to perform post-signup preparatory work before establishing an active session had no opt-in mechanism to sign up without automatically generating session tokens.

What is the new behavior?

  • Adds an optional create_session boolean property (defaults to true) to POST /signup request parameters.
  • When create_session: false is supplied, the user is created and auto-confirmed (if autoconfirm is enabled), but no session/refresh tokens are generated and no login metering is recorded. The endpoint returns the models.User object directly with 200 OK.
  • Retains 100% backwards compatibility: when create_session is omitted or set to true, the behavior is completely unchanged.
  • Adds comprehensive unit and integration tests in internal/api/signup_test.go.
  • Updates openapi.yaml schema and response documentation.
  • Improves build compatibility across platforms for socket reuse and signal handling tests.

Additional context

Verified against live PostgreSQL and test suites (go test -v ./internal/api -run TestSignup).

@YadneshTeli
YadneshTeli requested a review from a team as a code owner August 15, 2026 17:46
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.

Feature request: sign up a user without creating a session

1 participant