Skip to content

Commit

Permalink
feat: getSearchParameters also checks if codeFlowUrl is stored in the…
Browse files Browse the repository at this point in the history
… sessionStorage
  • Loading branch information
RaymondSanders committed Mar 7, 2023
1 parent 758881c commit db1de1f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/utils/url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,15 @@ export function getHashParameters<T>(): T {
}

export function getSearchParameters<T>(): T {
return parseQueryParameters(window.location.search);
const urlFromSessionStorage = sessionStorage.getItem('codeFlowUrl');
let url: string = window.location.search;

if (urlFromSessionStorage) {
url = urlFromSessionStorage;
sessionStorage.removeItem('codeFlowUrl');
}

return parseQueryParameters(url);
}

export function parseQueryParameters<T>(queryParametersString: string): T {
Expand Down

0 comments on commit db1de1f

Please sign in to comment.