Skip to content

Commit

Permalink
Fix bug when navigating back after logging in
Browse files Browse the repository at this point in the history
  • Loading branch information
garronej committed Oct 11, 2023
1 parent 8d05efc commit 2f0f060
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions web/src/core/adapters/oidc/oidc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,13 @@ export async function createOidc(params: {
url = result.newUrl;
}

// NOTE: Remove the query params from the url
window.history.pushState(null, "", url);
try {
await userManager.signinRedirectCallback(dummyUrl);
} catch {
//NOTE: The user has likely pressed the back button just after logging in.
}

await userManager.signinRedirectCallback(dummyUrl);
window.history.pushState(null, "", url);
}

let currentAccessToken = (await userManager.getUser())?.access_token ?? "";
Expand Down

0 comments on commit 2f0f060

Please sign in to comment.