File tree Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import {
12
12
isAuthError ,
13
13
isAuthRetryableFetchError ,
14
14
isAuthSessionMissingError ,
15
+ isAuthImplicitGrantRedirectError ,
15
16
} from './lib/errors'
16
17
import {
17
18
Fetch ,
@@ -314,8 +315,15 @@ export default class GoTrueClient {
314
315
if ( error ) {
315
316
this . _debug ( '#_initialize()' , 'error detecting session from URL' , error )
316
317
317
- if ( error ?. code === 'identity_already_exists' ) {
318
- return { error }
318
+ if ( isAuthImplicitGrantRedirectError ( error ) ) {
319
+ const errorCode = error . details ?. code
320
+ if (
321
+ errorCode === 'identity_already_exists' ||
322
+ errorCode === 'identity_not_found' ||
323
+ errorCode === 'single_identity_not_deletable'
324
+ ) {
325
+ return { error }
326
+ }
319
327
}
320
328
321
329
// failed login attempt via url,
Original file line number Diff line number Diff line change @@ -102,6 +102,12 @@ export class AuthImplicitGrantRedirectError extends CustomAuthError {
102
102
}
103
103
}
104
104
105
+ export function isAuthImplicitGrantRedirectError (
106
+ error : any
107
+ ) : error is AuthImplicitGrantRedirectError {
108
+ return isAuthError ( error ) && error . name === 'AuthImplicitGrantRedirectError'
109
+ }
110
+
105
111
export class AuthPKCEGrantCodeExchangeError extends CustomAuthError {
106
112
details : { error : string ; code : string } | null = null
107
113
Original file line number Diff line number Diff line change @@ -168,7 +168,7 @@ export async function processLock<R>(
168
168
169
169
const currentOperation = Promise . race (
170
170
[
171
- previousOperation . catch ( ( e : any ) => {
171
+ previousOperation . catch ( ( ) => {
172
172
// ignore error of previous operation that we're waiting to finish
173
173
return null
174
174
} ) ,
You can’t perform that action at this time.
0 commit comments