Skip to content

Commit

Permalink
Bugfix 404 response from getFlowError
Browse files Browse the repository at this point in the history
  • Loading branch information
eh-steve authored and Anonymous committed Aug 5, 2024
1 parent 28477dd commit a46048e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion examples/nextjs-spa/src/pages/error.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,16 @@ const Error: NextPageWithLayout = () => {
.then(({ data }) => {
setError(JSON.stringify(data, null, 2))
})
.catch(handleError)
.catch((error: AxiosError) => {
switch (error.response?.status) {
case 404: {
// The kratos handler for /self-service/errors?id=some_error_id currently only handles id=stub:500, and will 404 for everything else
// See https://github.com/ory/kratos/blob/4fb28b363622bb21ce12d9f89d2ceb4649aa0cba/selfservice/errorx/handler.go#L106
return;
}
}
handleError(error).then();
});
}
}, [err, id, router.isReady, handleError])

Expand Down

0 comments on commit a46048e

Please sign in to comment.