Skip to content

supabase-js 2.0rc8 - "After using client.auth.getUser overrides admin authorization header #534

@OverGreed

Description

@OverGreed

Bug report

Describe the bug

When I try to use the client on the backend I am getting overriding of Authorization headers for auth.admin.* when using auth.getUser(token)

To Reproduce

I am creating a client with
export const client = createClient(apiUrl, serviceKey);
After that inside my application, I am getting the user by token

await client.auth.getUser(token);

and after that all the requests with an auth.admin will send the users token instead of as serviceKey

supabase.auth.admin.inviteUserByEmail(email, {
  redirectTo,
});

Expected behavior

Using of auth.getUser(token) should not override token for auth.admin.*

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions