File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -128,7 +128,7 @@ export function addPasswordConfirmationInterceptors(axios: AxiosInstance): void
128128
129129 INTERCEPTOR_INITIALIZED = true
130130
131- let validatePromise : PromiseWithResolvers < void >
131+ let validatePromise : PromiseWithResolvers < void > | undefined
132132
133133 axios . interceptors . request . use (
134134 async ( config ) => {
@@ -175,6 +175,11 @@ export function addPasswordConfirmationInterceptors(axios: AxiosInstance): void
175175 return response
176176 }
177177
178+ if ( validatePromise === undefined ) {
179+ console . debug ( 'Password confirmation not required' , { response } )
180+ return response
181+ }
182+
178183 console . debug ( 'Password confirmation succeeded' , { response } )
179184 window . nc_lastLogin = Date . now ( ) / 1000
180185 validatePromise . resolve ( )
@@ -186,6 +191,11 @@ export function addPasswordConfirmationInterceptors(axios: AxiosInstance): void
186191 throw error
187192 }
188193
194+ if ( validatePromise === undefined ) {
195+ console . debug ( 'Password confirmation not required' , { error } )
196+ throw error
197+ }
198+
189199 console . debug ( 'Password confirmation failed' , { error } )
190200 validatePromise . reject ( error )
191201
You can’t perform that action at this time.
0 commit comments