oidc: remove authcallback.html from history

this way atleast token goes away from history. part of #844
This commit is contained in:
Girish Ramakrishnan
2025-07-10 14:01:45 +02:00
parent 01b1f7529e
commit 337c5412b7

View File

@@ -1,17 +1,18 @@
<script>
var tmp = window.location.hash.slice(1).split('&');
const tmp = window.location.hash.slice(1).split('&');
// FIXME: implicit flow (response_type=code token) results in access_token query param. this is not secure
tmp.forEach(function (pair) {
if (pair.indexOf('access_token=') === 0) localStorage.token = pair.split('=')[1];
});
var redirectTo = '/';
const redirectTo = '/';
if (localStorage.getItem('redirectToHash')) {
redirectTo += localStorage.getItem('redirectToHash');
localStorage.removeItem('redirectToHash');
}
window.location.href = redirectTo;
window.location.replace(redirectTo); // this removes us from history
</script>