diff --git a/webapp/assets/js/api.js b/webapp/assets/js/api.js index b37bddd..c0ed877 100644 --- a/webapp/assets/js/api.js +++ b/webapp/assets/js/api.js @@ -31,14 +31,14 @@ const API = (() => { headers: { 'x-access-token': module.token() } }); } catch (err) { - window.location.replace(`../login?redirect=${encodeURIComponent(window.location.pathname)}`); + window.location.href = `../login?redirect=${encodeURIComponent(window.location.pathname)}`; } } module.logout = () => { localStorage.removeItem('token'); Cookies.remove('x-access-token'); - window.location.replace(`../login`); + window.location.href = '../login'; } module.goToPlayer = () => { diff --git a/webapp/assets/js/mstream.js b/webapp/assets/js/mstream.js index dd1a13a..4a302c9 100644 --- a/webapp/assets/js/mstream.js +++ b/webapp/assets/js/mstream.js @@ -1412,7 +1412,7 @@ function logout(){ localStorage.removeItem('token'); Cookies.remove('x-access-token'); MSTREAMAPI.updateCurrentServer("", "", ""); - window.location.replace(`login`); + window.location.href = 'login'; } // Modals @@ -1472,7 +1472,7 @@ function testIt() { MSTREAMAPI.ping((response, error) => { if (error) { - window.location.replace(`login`); + window.location.href = 'login'; return; } diff --git a/webapp/login/index.js b/webapp/login/index.js index fc6a639..73b4084 100644 --- a/webapp/login/index.js +++ b/webapp/login/index.js @@ -11,7 +11,7 @@ async function checkToken() { headers: { 'x-access-token': localStorage.getItem('token') } }); - window.location.replace(`../`); + window.location.href = '../'; } catch (err) { // localStorage.removeItem('token'); } @@ -19,7 +19,7 @@ async function checkToken() { checkToken(); -document.getElementById("login").addEventListener("submit", async e =>{ +document.getElementById("login").addEventListener("submit", async e => { e.preventDefault(); // Lock Button @@ -40,7 +40,7 @@ document.getElementById("login").addEventListener("submit", async e =>{ const queryString = window.location.search; const urlParams = new URLSearchParams(queryString); const goTo = urlParams.get('redirect') ? '..' + urlParams.get('redirect') : '../'; - window.location.replace(goTo); + window.location.href = goTo; iziToast.success({ title: 'Login Success!',