Skip to content

Commit

Permalink
Clear URL after getting state and code
Browse files Browse the repository at this point in the history
  • Loading branch information
anderspitman committed Oct 1, 2024
1 parent ffac886 commit 9c45a9d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ async function checkAuthFlow() {
return;
}

window.history.replaceState(null, '', window.location.pathname);

const authRequestJson = localStorage.getItem(state);
localStorage.removeItem(state);

Expand All @@ -152,10 +154,6 @@ async function checkAuthFlow() {

const json = await res.json();

console.log(json);

window.history.replaceState(null, '', window.location.pathname);

return new Client({
token: json.access_token,
permissions: json.permissions,
Expand Down

0 comments on commit 9c45a9d

Please sign in to comment.