Update user-create-mutation.ts to not omit Cookie Data #18156
Merged
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.
Avoid stripping away cookie data and hence avoid having problems with Cookie Based Authentication Proxies
What kind of change does this PR introduce?
I'd assume it's a Bug as it unnecessarily strips away Cookies which other requests don't.
What is the current behavior?
https://github.com/supabase/supabase/blame/072222523afe612d575c2ff7e73e514692f545af/studio/data/auth/user-create-mutation.ts#L50
Currently credentials are stripped with
credentials: 'omit'
Ref: https://developer.mozilla.org/en-US/docs/Web/API/Request/credentials
That means that in any Proxy Setup which uses Authentication the Auth system cannot read the credentials and the request fails for no good reason.
What is the new behavior?
Credentials are not stripped, the default behaviour of passing credentials to the same site, which for obvious reasons is safe, is the new default.
Additional context
Was actually reported by one of the users (
colin
) in the YouTube video here https://www.youtube.com/watch?v=wyUr_U6Cma4