Skip to content

Commit

Permalink
fix(request) avoid using request url in the ui. fixes #289
Browse files Browse the repository at this point in the history
Signed-off-by: David Edler <david.edler@canonical.com>
  • Loading branch information
edlerd committed Sep 30, 2024
1 parent 3883fa3 commit 03e5b0e
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 24 deletions.
13 changes: 1 addition & 12 deletions ui/pages/reset_email.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,7 @@ const ResetEmail: NextPage = () => {
.createBrowserRecoveryFlow({
returnTo: returnTo ? String(returnTo) : undefined,
})
.then(async ({ data }) => {
if (data.request_url !== undefined) {
await router.push(
{
pathname: "reset_email",
query: { flow: data.id },
},
`${data.return_to}?flow=${data.id}`,
{ shallow: true },
);
return;
}
.then(({ data }) => {
setFlow(data);
})
.catch(handleFlowError("recovery", setFlow));
Expand Down
4 changes: 0 additions & 4 deletions ui/pages/reset_password.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ const ResetPassword: NextPage = () => {
returnTo: returnTo ? String(returnTo) : undefined,
})
.then(({ data }) => {
if (data.request_url !== undefined) {
window.location.href = data.request_url;
return;
}
setFlow(data);
})
.catch(handleFlowError("settings", setFlow))
Expand Down
4 changes: 0 additions & 4 deletions ui/pages/setup_backup_codes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ const SetupBackupCodes: NextPage = () => {
returnTo: returnTo ? String(returnTo) : undefined,
})
.then(({ data }) => {
if (data.request_url !== undefined) {
window.location.href = `./setup_backup_codes?flow=${data.id}`;
return;
}
setFlow(data);
})
.catch(handleFlowError("settings", setFlow))
Expand Down
4 changes: 0 additions & 4 deletions ui/pages/setup_passkey.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ const SetupPasskey: NextPage = () => {
returnTo: returnTo ? String(returnTo) : undefined,
})
.then(({ data }) => {
if (data.request_url !== undefined) {
window.location.href = `./setup_passkey?flow=${data.id}`;
return;
}
setFlow(data);
})
.catch(handleFlowError("settings", setFlow))
Expand Down

0 comments on commit 03e5b0e

Please sign in to comment.