Skip to content

Commit

Permalink
fix: redirect to login if settings get was unauthenticated (#369)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonas-jonas authored Feb 22, 2025
1 parent 1071d9f commit cdfea4c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ory/kratos-selfservice-ui-node",
"version": "0.22.1",
"version": "0.22.2",
"description": "A reference implementation of a selfservice UI for ORY Kratos in node.js",
"homepage": "https://github.com/ory/kratos-selfservice-ui-node#readme",
"bugs": {
Expand Down
7 changes: 7 additions & 0 deletions src/pkg/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,13 @@ export const redirectOnSoftError =
return
}

if (err.response.status === 401) {
// redirect to login
const query = new URLSearchParams()
query.set("return_to", redirectTo)
res.redirect(getUrlForFlow(apiBaseUrl, "login", query))
return
}
if (
err.response.status === 404 ||
err.response.status === 410 ||
Expand Down

0 comments on commit cdfea4c

Please sign in to comment.