another relative url fix

This commit is contained in:
IrosTheBeggar 2021-10-06 12:51:24 -04:00
parent fc68493958
commit 6282d5d2ac
3 changed files with 7 additions and 7 deletions

View File

@ -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 = () => {

View File

@ -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;
}

View File

@ -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!',