Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(auth): header being overridden #379

Merged
merged 1 commit into from
May 13, 2024
Merged

Conversation

leoMehlig
Copy link
Contributor

I noticed that auth calls like updateUser would fail due to a wrong JWT token. The cause for this was, that the execute method would override the Authentication header to the anon key. I changed the call, such that the execute method does not override existing headers.

@leoMehlig leoMehlig requested a review from grdsdev as a code owner May 12, 2024 19:37
@grdsdev
Copy link
Collaborator

grdsdev commented May 13, 2024

Hi @leoMehlig I don't see this issue happening on my tests, do you have a reproducible example?

@leoMehlig
Copy link
Contributor Author

Does it not override the session.accessToken with the API key for you?

@grdsdev
Copy link
Collaborator

grdsdev commented May 13, 2024

Does it not override the session.accessToken with the API key for you?

It doesn't, I'm verifying with the following test: https://github.com/supabase/supabase-swift/blob/main/Tests/IntegrationTests/AuthClientIntegrationTests.swift#L139

@leoMehlig
Copy link
Contributor Author

Does it not override the session.accessToken with the API key for you?

It doesn't, I'm verifying with the following test: https://github.com/supabase/supabase-swift/blob/main/Tests/IntegrationTests/AuthClientIntegrationTests.swift#L139

I think the difference in the test is, that it does not have a Authorization header set in the text, but in production this is set to the apiKey.

@grdsdev grdsdev changed the title Fix header being overriden in auth fix(auth): header being overridden May 13, 2024
@grdsdev grdsdev merged commit 866a039 into supabase:main May 13, 2024
10 checks passed
@grdsdev
Copy link
Collaborator

grdsdev commented May 13, 2024

Got it @leoMehlig thanks for the fix.

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