Skip to content

Commit c559f8c

Browse files
committed
Adds another ory fix
1 parent 04818dd commit c559f8c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pkg/errors.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@ export function handleGetFlowError<S>(
1010
resetFlow: Dispatch<SetStateAction<S | undefined>>,
1111
) {
1212
return async (err: AxiosError) => {
13-
switch (err.response?.data.error?.id) {
13+
switch ((err.response?.data as any).error?.id) {
1414
case "session_aal2_required":
1515
// 2FA is enabled and enforced, but user did not perform 2fa yet!
16-
window.location.href = err.response?.data.redirect_browser_to
16+
window.location.href = (err.response?.data as any).redirect_browser_to
1717
return
1818
case "session_already_available":
1919
// User is already signed in, let's redirect them home!
2020
await router.push("/welcome")
2121
return
2222
case "session_refresh_required":
2323
// We need to re-authenticate to perform this action
24-
window.location.href = err.response?.data.redirect_browser_to
24+
window.location.href = (err.response?.data as any).redirect_browser_to
2525
return
2626
case "self_service_flow_return_to_forbidden":
2727
// The flow expired, let's request a new one.
@@ -50,7 +50,7 @@ export function handleGetFlowError<S>(
5050
return
5151
case "browser_location_change_required":
5252
// Ory Kratos asked us to point the user to this URL.
53-
window.location.href = err.response.data.redirect_browser_to
53+
window.location.href = (err.response?.data as any).redirect_browser_to
5454
return
5555
}
5656

0 commit comments

Comments
 (0)