Skip to content

Commit 30ea366

Browse files
committed
update error handling for user not found
1 parent c555280 commit 30ea366

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/template-retail-react-app/app/hooks/use-auth-modal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export const AuthModal = ({
106106
await authorizePasswordlessLogin.mutateAsync({userid: email})
107107
setCurrentView(EMAIL_VIEW)
108108
} catch (error) {
109-
const message = /error getting user info/i.test(error.message)
109+
const message = /user not found/i.test(error.message)
110110
? formatMessage(CREATE_ACCOUNT_FIRST_ERROR_MESSAGE)
111111
: PASSWORDLESS_ERROR_MESSAGES.some((msg) => msg.test(error.message))
112112
? formatMessage(FEATURE_UNAVAILABLE_ERROR_MESSAGE)

packages/template-retail-react-app/app/pages/login/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ const Login = ({initialView = LOGIN_VIEW}) => {
111111
await authorizePasswordlessLogin.mutateAsync({userid: email})
112112
setCurrentView(EMAIL_VIEW)
113113
} catch (error) {
114-
const message = /error getting user info/i.test(error.message)
114+
const message = /user not found/i.test(error.message)
115115
? formatMessage(CREATE_ACCOUNT_FIRST_ERROR_MESSAGE)
116116
: PASSWORDLESS_ERROR_MESSAGES.some((msg) => msg.test(error.message))
117117
? formatMessage(FEATURE_UNAVAILABLE_ERROR_MESSAGE)

0 commit comments

Comments
 (0)