0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-30 20:33:54 -05:00

Merge pull request #3121 from logto-io/simeng-continue-flow-code-verification

fix(ui): fix continue flow verification-code 404 bug
This commit is contained in:
simeng-li 2023-02-15 19:02:58 +08:00 committed by GitHub
commit c6e3ecb23c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 7 deletions

View file

@ -95,14 +95,14 @@ const App = () => {
<Route path="reset" element={<ResetPassword />} /> <Route path="reset" element={<ResetPassword />} />
</Route> </Route>
{/* Passwordless verification code */}
<Route path=":flow/verification-code" element={<VerificationCode />} />
{/* Continue set up missing profile */} {/* Continue set up missing profile */}
<Route path="continue"> <Route path="continue">
<Route path=":method" element={<Continue />} /> <Route path=":method" element={<Continue />} />
</Route> </Route>
{/* Passwordless verification code */}
<Route path=":flow/verification-code" element={<VerificationCode />} />
{/* Social sign-in pages */} {/* Social sign-in pages */}
<Route path="social"> <Route path="social">
<Route path="link/:connectorId" element={<SocialLinkAccount />} /> <Route path="link/:connectorId" element={<SocialLinkAccount />} />

View file

@ -46,7 +46,7 @@ const useSendVerificationCode = (flow: UserFlow, replaceCurrentPage?: boolean) =
if (result) { if (result) {
navigate( navigate(
{ {
pathname: `verification-code`, pathname: `/${flow}/verification-code`,
search: location.search, search: location.search,
}, },
{ {

View file

@ -5,7 +5,7 @@ import { MemoryRouter } from 'react-router-dom';
import renderWithPageContext from '@/__mocks__/RenderWithPageContext'; import renderWithPageContext from '@/__mocks__/RenderWithPageContext';
import { putInteraction, sendVerificationCode } from '@/apis/interaction'; import { putInteraction, sendVerificationCode } from '@/apis/interaction';
import { VerificationCodeIdentifier } from '@/types'; import { UserFlow, VerificationCodeIdentifier } from '@/types';
import ForgotPasswordForm from '.'; import ForgotPasswordForm from '.';
@ -81,7 +81,7 @@ describe('ForgotPasswordForm', () => {
expect(sendVerificationCode).toBeCalledWith({ email }); expect(sendVerificationCode).toBeCalledWith({ email });
expect(mockedNavigate).toBeCalledWith( expect(mockedNavigate).toBeCalledWith(
{ {
pathname: 'verification-code', pathname: `/${UserFlow.forgotPassword}/verification-code`,
search: '', search: '',
}, },
{ state: { identifier, value }, replace: undefined } { state: { identifier, value }, replace: undefined }

View file

@ -7,6 +7,7 @@ import {
putInteraction, putInteraction,
sendVerificationCode, sendVerificationCode,
} from '@/apis/interaction'; } from '@/apis/interaction';
import { UserFlow } from '@/types';
import PasswordForm from '.'; import PasswordForm from '.';
@ -89,7 +90,7 @@ describe('PasswordSignInForm', () => {
expect(mockedNavigate).toBeCalledWith( expect(mockedNavigate).toBeCalledWith(
{ {
pathname: 'verification-code', pathname: `/${UserFlow.signIn}/verification-code`,
search: '', search: '',
}, },
{ {