File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
packages/template-retail-react-app/app/components/passkey-registration-modal Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ const PasskeyRegistrationModal = ({isOpen, onClose}) => {
5353 const commerceApiConfig = config . app . commerceAPI
5454 const webauthnConfig = config . app . login . passkey
5555 const authorizeWebauthnRegistration = useAuthHelper ( AuthHelpers . AuthorizeWebauthnRegistration )
56+ const startWebauthnUserRegistration = useAuthHelper ( AuthHelpers . StartWebauthnUserRegistration )
5657
5758 const handleRegisterPasskey = async ( ) => {
5859 setIsLoading ( true )
@@ -80,8 +81,14 @@ const PasskeyRegistrationModal = ({isOpen, onClose}) => {
8081 }
8182
8283 const handleOtpVerification = async ( code ) => {
83- // TODO: Implement OTP verification
84- return { success : true }
84+ try {
85+ await startWebauthnUserRegistration . mutateAsync ( {
86+ user_id : customer . email ,
87+ pwd_action_token : code
88+ } )
89+ } catch ( err ) {
90+ setError ( err . message || 'Failed to start webauthn user registration' )
91+ }
8592 }
8693
8794 const resetState = ( ) => {
You can’t perform that action at this time.
0 commit comments