File tree 1 file changed +8
-4
lines changed
packages/app/features/auth/sign-up
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,9 @@ enum PageState {
35
35
BackUpPrompt = 'BackUpPrompt' ,
36
36
}
37
37
38
+ const WEBKIT_CANCEL_PASSKEY_PROMPT_ERROR_NAME = 'NotAllowedError'
39
+ const FIREFOX_CANCEL_PASSKEY_PROMPT_ERROR_NAME = 'AbortError'
40
+
38
41
export const SignUpForm = ( ) => {
39
42
const form = useForm < z . infer < typeof SignUpSchema > > ( )
40
43
const router = useRouter ( )
@@ -85,11 +88,12 @@ export const SignUpForm = () => {
85
88
86
89
router . push ( redirectUri ?? '/' )
87
90
} catch ( error ) {
88
- if (
89
- isPhoneAlreadyUsed &&
91
+ const wasPasskeyPromptCanceled =
90
92
error . constructor . name === 'DOMException' &&
91
- error . name === 'NotAllowedError'
92
- ) {
93
+ ( error . name === WEBKIT_CANCEL_PASSKEY_PROMPT_ERROR_NAME ||
94
+ error . name === FIREFOX_CANCEL_PASSKEY_PROMPT_ERROR_NAME )
95
+
96
+ if ( isPhoneAlreadyUsed && wasPasskeyPromptCanceled ) {
93
97
setPageState ( PageState . BackUpPrompt )
94
98
return
95
99
}
You can’t perform that action at this time.
0 commit comments