File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -23,19 +23,19 @@ export const resolveHeadersConstructor = () => {
23
23
}
24
24
25
25
export const fetchWithAuth = (
26
- supabaseAnonKey : string ,
26
+ supabaseKey : string ,
27
27
getAccessToken : ( ) => Promise < string | null > ,
28
28
customFetch ?: Fetch
29
29
) : Fetch => {
30
30
const fetch = resolveFetch ( customFetch )
31
31
const HeadersConstructor = resolveHeadersConstructor ( )
32
32
33
33
return async ( input , init ) => {
34
- const accessToken = ( await getAccessToken ( ) ) ?? supabaseAnonKey
34
+ const accessToken = ( await getAccessToken ( ) ) ?? supabaseKey
35
35
let headers = new HeadersConstructor ( init ?. headers )
36
36
37
37
if ( ! headers . has ( 'apikey' ) ) {
38
- headers . append ( 'apikey' , supabaseAnonKey )
38
+ headers . set ( 'apikey' , supabaseKey )
39
39
}
40
40
41
41
if ( ! headers . has ( 'Authorization' ) ) {
You can’t perform that action at this time.
0 commit comments