2023-06-02 20:47:36 +02:00
|
|
|
<script>
|
|
|
|
|
|
2025-07-10 14:01:45 +02:00
|
|
|
const tmp = window.location.hash.slice(1).split('&');
|
2023-06-02 20:47:36 +02:00
|
|
|
|
2025-07-10 13:06:13 +02:00
|
|
|
// FIXME: implicit flow (response_type=code token) results in access_token query param. this is not secure
|
2023-06-02 20:47:36 +02:00
|
|
|
tmp.forEach(function (pair) {
|
|
|
|
|
if (pair.indexOf('access_token=') === 0) localStorage.token = pair.split('=')[1];
|
|
|
|
|
});
|
|
|
|
|
|
2025-07-10 14:01:45 +02:00
|
|
|
const redirectTo = '/';
|
2024-04-29 15:22:01 +02:00
|
|
|
if (localStorage.getItem('redirectToHash')) {
|
|
|
|
|
redirectTo += localStorage.getItem('redirectToHash');
|
|
|
|
|
localStorage.removeItem('redirectToHash');
|
|
|
|
|
}
|
2025-07-10 14:01:45 +02:00
|
|
|
|
|
|
|
|
window.location.replace(redirectTo); // this removes us from history
|
2023-06-02 20:47:36 +02:00
|
|
|
|
|
|
|
|
</script>
|