File tree Expand file tree Collapse file tree 3 files changed +9
-5
lines changed
packages/template-retail-react-app/app Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -265,3 +265,5 @@ export const PASSWORDLESS_ERROR_MESSAGES = [
265265]
266266
267267export const INVALID_TOKEN_ERROR = / i n v a l i d t o k e n / i
268+
269+ export const USER_NOT_FOUND_ERROR = / u s e r n o t f o u n d / i
Original file line number Diff line number Diff line change @@ -33,10 +33,11 @@ import PasswordlessEmailConfirmation from '@salesforce/retail-react-app/app/comp
3333import { noop } from '@salesforce/retail-react-app/app/utils/utils'
3434import {
3535 API_ERROR_MESSAGE ,
36- FEATURE_UNAVAILABLE_ERROR_MESSAGE ,
3736 CREATE_ACCOUNT_FIRST_ERROR_MESSAGE ,
37+ FEATURE_UNAVAILABLE_ERROR_MESSAGE ,
3838 LOGIN_TYPES ,
39- PASSWORDLESS_ERROR_MESSAGES
39+ PASSWORDLESS_ERROR_MESSAGES ,
40+ USER_NOT_FOUND_ERROR
4041} from '@salesforce/retail-react-app/app/constants'
4142import useNavigation from '@salesforce/retail-react-app/app/hooks/use-navigation'
4243import { usePrevious } from '@salesforce/retail-react-app/app/hooks/use-previous'
@@ -106,7 +107,7 @@ export const AuthModal = ({
106107 await authorizePasswordlessLogin . mutateAsync ( { userid : email } )
107108 setCurrentView ( EMAIL_VIEW )
108109 } catch ( error ) {
109- const message = / u s e r n o t f o u n d / i . test ( error . message )
110+ const message = USER_NOT_FOUND_ERROR . test ( error . message )
110111 ? formatMessage ( CREATE_ACCOUNT_FIRST_ERROR_MESSAGE )
111112 : PASSWORDLESS_ERROR_MESSAGES . some ( ( msg ) => msg . test ( error . message ) )
112113 ? formatMessage ( FEATURE_UNAVAILABLE_ERROR_MESSAGE )
Original file line number Diff line number Diff line change @@ -27,13 +27,14 @@ import LoginForm from '@salesforce/retail-react-app/app/components/login'
2727import PasswordlessEmailConfirmation from '@salesforce/retail-react-app/app/components/email-confirmation/index'
2828import {
2929 API_ERROR_MESSAGE ,
30+ CREATE_ACCOUNT_FIRST_ERROR_MESSAGE ,
3031 INVALID_TOKEN_ERROR ,
3132 INVALID_TOKEN_ERROR_MESSAGE ,
3233 FEATURE_UNAVAILABLE_ERROR_MESSAGE ,
3334 LOGIN_TYPES ,
3435 PASSWORDLESS_LOGIN_LANDING_PATH ,
3536 PASSWORDLESS_ERROR_MESSAGES ,
36- CREATE_ACCOUNT_FIRST_ERROR_MESSAGE
37+ USER_NOT_FOUND_ERROR
3738} from '@salesforce/retail-react-app/app/constants'
3839import { usePrevious } from '@salesforce/retail-react-app/app/hooks/use-previous'
3940import { isServer } from '@salesforce/retail-react-app/app/utils/utils'
@@ -111,7 +112,7 @@ const Login = ({initialView = LOGIN_VIEW}) => {
111112 await authorizePasswordlessLogin . mutateAsync ( { userid : email } )
112113 setCurrentView ( EMAIL_VIEW )
113114 } catch ( error ) {
114- const message = / u s e r n o t f o u n d / i . test ( error . message )
115+ const message = USER_NOT_FOUND_ERROR . test ( error . message )
115116 ? formatMessage ( CREATE_ACCOUNT_FIRST_ERROR_MESSAGE )
116117 : PASSWORDLESS_ERROR_MESSAGES . some ( ( msg ) => msg . test ( error . message ) )
117118 ? formatMessage ( FEATURE_UNAVAILABLE_ERROR_MESSAGE )
You can’t perform that action at this time.
0 commit comments