Skip to content

Commit 77a8a9e

Browse files
committed
fix: update routing paths to remove /auth prefix for consistency
1 parent fa3bf67 commit 77a8a9e

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

ui/src/app/registration/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const SignUpContent: React.FC = () => {
5858
if (!flow?.id) return
5959

6060
// Keep flow id in URL so reloads don’t lose state
61-
router.push(`/auth/registration?flow=${flow.id}`)
61+
router.push(`/registration?flow=${flow.id}`)
6262

6363
try {
6464
const { data } = await ory.updateRegistrationFlow({
@@ -70,7 +70,7 @@ const SignUpContent: React.FC = () => {
7070
if (data.continue_with && data.continue_with.length > 0) {
7171
for (const item of data.continue_with) {
7272
if (item.action === 'show_verification_ui') {
73-
router.push(`/auth/verification?flow=${item.flow.id}`)
73+
router.push(`/verification?flow=${item.flow.id}`)
7474
return
7575
}
7676
}

ui/src/app/verification/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ const Page: NextPage = () => {
6464
if (!flow?.id) return
6565

6666
// Keep flow ID in the URL so reloads don’t lose state
67-
router.push(`/auth/verification?flow=${flow.id}`)
67+
router.push(`/verification?flow=${flow.id}`)
6868

6969
try {
7070
const { data } = await ory.updateVerificationFlow({
@@ -87,7 +87,7 @@ const Page: NextPage = () => {
8787
const payload = anyErr.response.data as { use_flow_id?: string }
8888
if (payload.use_flow_id) {
8989
const newFlowID = payload.use_flow_id
90-
router.push(`/auth/verification?flow=${newFlowID}`)
90+
router.push(`/verification?flow=${newFlowID}`)
9191
const { data } = await ory.getVerificationFlow({ id: newFlowID })
9292
setFlow(data)
9393
return

ui/src/pkg/errors.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export function handleGetFlowError<S>(
1313
// @ts-expect-error - response.data type is not properly typed in axios
1414
switch (err.response?.data.error?.id) {
1515
case 'session_inactive':
16-
router.push(`/auth/login?return_to=${window.location.href}`)
16+
router.push(`/login?return_to=${window.location.href}`)
1717
return
1818
case 'session_aal2_required':
1919
// 2FA is enabled and enforced, but user did not perform 2fa yet!
@@ -28,7 +28,7 @@ export function handleGetFlowError<S>(
2828
window.location.href = redirectTo.toString()
2929
return
3030
}
31-
router.push(`/auth/login?aal=aal2&return_to=${window.location.href}`)
31+
router.push(`/login?aal=aal2&return_to=${window.location.href}`)
3232
return
3333
case 'session_already_available':
3434
// User is already signed in, let's redirect them home!
@@ -43,24 +43,24 @@ export function handleGetFlowError<S>(
4343
// The flow expired, let's request a new one.
4444
toast.error('The return_to address is not allowed.')
4545
resetFlow(undefined)
46-
router.push(`/auth/${flowType}`)
46+
router.push(`/${flowType}`)
4747
return
4848
case 'self_service_flow_expired':
4949
// The flow expired, let's request a new one.
5050
toast.error('Your interaction expired, please fill out the form again.')
5151
resetFlow(undefined)
52-
router.push(`/auth/${flowType}`)
52+
router.push(`/${flowType}`)
5353
return
5454
case 'security_csrf_violation':
5555
// A CSRF violation occurred. Best to just refresh the flow!
5656
toast.error('A security violation was detected, please fill out the form again.')
5757
resetFlow(undefined)
58-
router.push(`/auth/${flowType}`)
58+
router.push(`/${flowType}`)
5959
return
6060
case 'security_identity_mismatch':
6161
// The requested item was intended for someone else. Let's request a new flow...
6262
resetFlow(undefined)
63-
router.push(`/auth/${flowType}`)
63+
router.push(`/${flowType}`)
6464
return
6565
case 'browser_location_change_required':
6666
// Ory Kratos asked us to point the user to this URL.
@@ -75,7 +75,7 @@ export function handleGetFlowError<S>(
7575
case 410:
7676
// The flow expired, let's request a new one.
7777
resetFlow(undefined)
78-
router.push(`/auth/${flowType}`)
78+
router.push(`/${flowType}`)
7979
return
8080
default:
8181
// Otherwise, we nothitng - the error will be handled by the Flow component

0 commit comments

Comments
 (0)