Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix incorrect loading of admin ui settings page #2805

Merged
merged 3 commits into from
Jul 15, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions packages/frontend/app/routes/settings.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { json, redirect, type LoaderFunctionArgs } from '@remix-run/node'
import {
json,
redirectDocument,
type LoaderFunctionArgs
} from '@remix-run/node'
import { uuidSchema } from '~/lib/validate.server'
import {
isUiNodeInputAttributes,
Expand Down Expand Up @@ -39,7 +43,7 @@ export const loader = async ({ request }: LoaderFunctionArgs) => {

return { responseData }
} else {
return redirect(
return redirectDocument(
`${variables.kratosBrowserPublicUrl}/self-service/settings/browser`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this the only place this is needed?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We only found issue with the settings page.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mkurapov is actually a very good question. It made me realise that we need to make improvements on catching direct references to the login page and account recovery page as well! Both were already redirecting to the kratos endpoint when the login / Forgot password? buttons were clicked but weren't handling direct navigation optimally and should also be using redirectDocument if they are navigated to directly instead of just throwing an error.

I'm going to include an additional commit now that covers this as well.

)
}
Expand Down
Loading