Skip to content

Commit faa5454

Browse files
committed
test commit (revert use-auth-modal to develop)
1 parent 8271c9f commit faa5454

File tree

2 files changed

+12
-428
lines changed

2 files changed

+12
-428
lines changed

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

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ import {usePrevious} from '@salesforce/retail-react-app/app/hooks/use-previous'
4343
import {usePasswordReset} from '@salesforce/retail-react-app/app/hooks/use-password-reset'
4444
import {isServer} from '@salesforce/retail-react-app/app/utils/utils'
4545
import {getConfig} from '@salesforce/pwa-kit-runtime/utils/ssr-config'
46-
import {usePasskeyRegistration} from '@salesforce/retail-react-app/app/hooks/use-passkey-registration'
47-
import {usePasskeyLogin} from '@salesforce/retail-react-app/app/hooks/use-passkey-login'
4846
import {getPasswordlessCallbackUrl} from '@salesforce/retail-react-app/app/utils/auth-utils'
4947
import useMultiSite from '@salesforce/retail-react-app/app/hooks/use-multi-site'
5048

@@ -75,7 +73,7 @@ export const AuthModal = ({
7573
const customerId = useCustomerId()
7674
const {isRegistered, customerType} = useCustomerType()
7775
const prevAuthType = usePrevious(customerType)
78-
const {loginWithPasskey} = usePasskeyLogin()
76+
7977
const customer = useCustomer(
8078
{parameters: {customerId}},
8179
{enabled: !!customerId && isRegistered}
@@ -103,8 +101,6 @@ export const AuthModal = ({
103101
)
104102
const mergeBasket = useShopperBasketsMutation('mergeBasket')
105103

106-
const {showRegisterPasskeyToast} = usePasskeyRegistration()
107-
108104
const handlePasswordlessLogin = async (email) => {
109105
try {
110106
const redirectPath = window.location.pathname + (window.location.search || '')
@@ -237,10 +233,6 @@ export const AuthModal = ({
237233
if (isOpen) {
238234
setCurrentView(initialView)
239235
form.reset()
240-
// Prompt user to login without username (discoverable credentials)
241-
loginWithPasskey().catch(() => {
242-
form.setError('global', {type: 'manual', message: formatMessage(API_ERROR_MESSAGE)})
243-
})
244236
}
245237
}, [isOpen])
246238

@@ -278,12 +270,8 @@ export const AuthModal = ({
278270
onClose()
279271
setIsOtpAuthOpen(false)
280272

281-
// Show passkey registration prompt if supported
282-
showRegisterPasskeyToast()
283-
284273
// Show a toast only for those registed users returning to the site.
285-
// Only show toast when customer data is available (user is logged in and data is loaded)
286-
if (loggingIn && customer.data) {
274+
if (loggingIn) {
287275
toast({
288276
variant: 'subtle',
289277
title: `${formatMessage(
@@ -313,7 +301,7 @@ export const AuthModal = ({
313301
// Execute action to be performed on successful registration
314302
onRegistrationSuccess()
315303
}
316-
}, [isRegistered, customer.data])
304+
}, [isRegistered])
317305

318306
const onBackToSignInClick = () =>
319307
initialView === PASSWORD_VIEW ? onClose() : setCurrentView(LOGIN_VIEW)

0 commit comments

Comments
 (0)