Skip to content

Commit

Permalink
ui: dynamically update url with flow query parameter on reset email f…
Browse files Browse the repository at this point in the history
…low initialization instead of redirecting

Signed-off-by: David Edler <[email protected]>
  • Loading branch information
edlerd committed Jun 19, 2024
1 parent abb1732 commit f4d960c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions ui/pages/reset_email.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,16 @@ const ResetEmail: NextPage = () => {
.createBrowserRecoveryFlow({
returnTo: returnTo ? String(returnTo) : undefined,
})
.then(({ data }) => {
.then(async ({ data }) => {
if (data.request_url !== undefined) {
window.location.href = data.return_to + "?flow=" + data.id;
await router.push(
{
pathname: "reset_email",
query: { flow: data.id },
},
`${data.return_to}?flow=${data.id}`,
{ shallow: true },
);
return;
}
setFlow(data);
Expand Down

0 comments on commit f4d960c

Please sign in to comment.