feat(api): allow signup without creating a session (#2586) - #2700
Open
YadneshTeli wants to merge 2 commits into
Open
feat(api): allow signup without creating a session (#2586)#2700YadneshTeli wants to merge 2 commits into
YadneshTeli wants to merge 2 commits into
Conversation
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.
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 /signupendpoint 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_INor 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?
create_sessionboolean property (defaults totrue) toPOST /signuprequest parameters.create_session: falseis 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 themodels.Userobject directly with200 OK.create_sessionis omitted or set totrue, the behavior is completely unchanged.internal/api/signup_test.go.openapi.yamlschema and response documentation.Additional context
Verified against live PostgreSQL and test suites (
go test -v ./internal/api -run TestSignup).