diff --git a/src/components/AuthCallback/AuthCallback.tsx b/src/components/AuthCallback/AuthCallback.tsx index ed917e5d..18d167a2 100644 --- a/src/components/AuthCallback/AuthCallback.tsx +++ b/src/components/AuthCallback/AuthCallback.tsx @@ -249,44 +249,42 @@ function AuthCallbackPage() { networkId }); - try { - await window.fastAuthController.setKey(keypair); - await window.fastAuthController.claimOidcToken(user.accessToken); - (window as any).firestoreController = new FirestoreController(); - window.firestoreController.updateUser({ - userUid: user.uid, - oidcToken: user.accessToken, - }); + await window.fastAuthController.setKey(keypair); + await window.fastAuthController.claimOidcToken(user.accessToken); + (window as any).firestoreController = new FirestoreController(); + window.firestoreController.updateUser({ + userUid: user.uid, + oidcToken: user.accessToken, + }); - const callback = isRecovery ? onSignIn : onCreateAccount; - await callback({ - keypair, - accessToken: user.accessToken, - accountId, - publicKeyFak, - public_key_lak, - contract_id, - methodNames, - success_url, - setStatusMessage, - email, - navigate, - searchParams, - gateway: success_url, - }); - } catch (e) { - console.log('error:', e); - const { message } = e; - const parsedUrl = new URL(failure_url || success_url || window.location.origin); - parsedUrl.searchParams.set('code', e.code); - parsedUrl.searchParams.set('reason', message); - window.location.replace(parsedUrl.href); - openToast({ - type: 'ERROR', - title: message, - }); - } + const callback = isRecovery ? onSignIn : onCreateAccount; + await callback({ + keypair, + accessToken: user.accessToken, + accountId, + publicKeyFak, + public_key_lak, + contract_id, + methodNames, + success_url, + setStatusMessage, + email, + navigate, + searchParams, + gateway: success_url, + }); } + }).catch((e) => { + console.log('error:', e); + const { message } = e; + const parsedUrl = new URL(failure_url || success_url || window.location.origin); + parsedUrl.searchParams.set('code', e.code); + parsedUrl.searchParams.set('reason', message); + window.location.replace(parsedUrl.href); + openToast({ + type: 'ERROR', + title: message, + }); }); } else { navigate('/signup');