File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ const DEFAULT_AUTH_OPTIONS: SupabaseAuthClientOptions = {
30
30
autoRefreshToken : true ,
31
31
persistSession : true ,
32
32
detectSessionInUrl : true ,
33
+ flowType : 'implicit' ,
33
34
}
34
35
35
36
const DEFAULT_REALTIME_OPTIONS : RealtimeClientOptions = { }
@@ -244,6 +245,7 @@ export default class SupabaseClient<
244
245
detectSessionInUrl,
245
246
storage,
246
247
storageKey,
248
+ flowType,
247
249
} : SupabaseAuthClientOptions ,
248
250
headers ?: Record < string , string > ,
249
251
fetch ?: Fetch
@@ -260,6 +262,7 @@ export default class SupabaseClient<
260
262
persistSession,
261
263
detectSessionInUrl,
262
264
storage,
265
+ flowType,
263
266
fetch,
264
267
} )
265
268
}
@@ -291,7 +294,7 @@ export default class SupabaseClient<
291
294
this . realtime . setAuth ( token ?? null )
292
295
293
296
this . changedAccessToken = token
294
- } else if ( event === 'SIGNED_OUT' || event === 'USER_DELETED' ) {
297
+ } else if ( event === 'SIGNED_OUT' ) {
295
298
// Token is removed
296
299
this . realtime . setAuth ( this . supabaseKey )
297
300
if ( source == 'STORAGE' ) this . auth . signOut ( )
Original file line number Diff line number Diff line change @@ -36,6 +36,10 @@ export type SupabaseClientOptions<SchemaName> = {
36
36
* A storage provider. Used to store the logged-in session.
37
37
*/
38
38
storage ?: SupabaseAuthClientOptions [ 'storage' ]
39
+ /**
40
+ * OAuth flow to use - defaults to implicit flow. PKCE is recommended for mobile and server-side applications.
41
+ */
42
+ flowType ?: SupabaseAuthClientOptions [ 'flowType' ]
39
43
}
40
44
/**
41
45
* Options passed to the realtime-js instance
You can’t perform that action at this time.
0 commit comments