-
-
Notifications
You must be signed in to change notification settings - Fork 222
fix: hide recovery link on refresh #263
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -135,20 +135,22 @@ export const createLoginRoute: RouteCreator = | |
) | ||
} | ||
|
||
let initRecoveryUrl = "" | ||
const initRegistrationUrl = getUrlForFlow( | ||
kratosBrowserUrl, | ||
"registration", | ||
initRegistrationQuery, | ||
) | ||
|
||
const initRecoveryUrl = getUrlForFlow( | ||
kratosBrowserUrl, | ||
"recovery", | ||
new URLSearchParams({ | ||
return_to: | ||
(return_to && return_to.toString()) || flow.return_to || "", | ||
}), | ||
) | ||
if (flow.refresh) { | ||
initRecoveryUrl = getUrlForFlow( | ||
kratosBrowserUrl, | ||
"recovery", | ||
new URLSearchParams({ | ||
return_to: | ||
(return_to && return_to.toString()) || flow.return_to || "", | ||
}), | ||
) | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what happens if we don't refresh the flow at all and we are logging in for the first time? Then the recovery link will be gone right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A better way might be to retrieve the session and then check if the user is already logged in. Based on that + refresh true we can hide the recovery link. We will also need to omit the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ups, that should be inverted. Thanks! |
||
|
||
res.render("login", { | ||
nodes: flow.ui.nodes, | ||
|
Uh oh!
There was an error while loading. Please reload this page.