Skip to content

Commit bbe9a55

Browse files
authored
feat: Use additional headers from SupabaseClient into GotrueClient. (#218)
1 parent 60e8c2a commit bbe9a55

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/SupabaseClient.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,15 @@ export default class SupabaseClient {
147147
persistSession,
148148
detectSessionInUrl,
149149
localStorage,
150+
headers
150151
}: SupabaseClientOptions) {
152+
const authHeaders = {
153+
Authorization: `Bearer ${this.supabaseKey}`,
154+
apikey: `${this.supabaseKey}`,
155+
}
151156
return new SupabaseAuthClient({
152157
url: this.authUrl,
153-
headers: {
154-
Authorization: `Bearer ${this.supabaseKey}`,
155-
apikey: `${this.supabaseKey}`,
156-
},
158+
headers: { ...headers, ...authHeaders },
157159
autoRefreshToken,
158160
persistSession,
159161
detectSessionInUrl,

0 commit comments

Comments
 (0)