fix(fe1): post-auth redirect broken after access_code querystring removal

This commit is contained in:
Kristaps Fabians Geikins
2023-07-03 17:08:41 +03:00
parent 30fdc71fcd
commit a50f8dca3a
+4 -3
View File
@@ -77,9 +77,10 @@ async function init() {
if (!authToken) {
const gotToken = await checkAccessCodeAndGetTokens()
if (gotToken) {
// token was retrieved - remove access code
window.location.href = '/'
return
// Remove access_code get param from current url
const url = new URL(window.location.href)
url.searchParams.delete('access_code')
window.history.replaceState({}, document.title, url.toString())
}
}