File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -298,10 +298,13 @@ export async function beginEmailChangeReauth(): Promise<string> {
298298 return token ;
299299 } catch ( err : unknown ) {
300300 const webauthnErr = err as WebAuthnError ;
301+ if ( webauthnErr . name === 'NotAllowedError' ) {
302+ throw new Error ( 'Passkey verification was cancelled or timed out.' ) ;
303+ }
301304 if ( webauthnErr . response ?. data ?. error ) {
302305 throw new Error ( webauthnErr . response . data . error ) ;
303306 }
304- throw new Error ( webauthnErr . message || 'Passkey reauthentication failed' ) ;
307+ throw new Error ( webauthnErr . message || 'Passkey reauthentication failed. ' ) ;
305308 }
306309}
307310
@@ -322,9 +325,12 @@ export async function beginAccountDeletionReauth(): Promise<string> {
322325 return token ;
323326 } catch ( err : unknown ) {
324327 const webauthnErr = err as WebAuthnError ;
328+ if ( webauthnErr . name === 'NotAllowedError' ) {
329+ throw new Error ( 'Passkey verification was cancelled or timed out.' ) ;
330+ }
325331 if ( webauthnErr . response ?. data ?. error ) {
326332 throw new Error ( webauthnErr . response . data . error ) ;
327333 }
328- throw new Error ( webauthnErr . message || 'Passkey reauthentication failed' ) ;
334+ throw new Error ( webauthnErr . message || 'Passkey reauthentication failed. ' ) ;
329335 }
330336}
You can’t perform that action at this time.
0 commit comments