handle browser setting the text as undefined
This commit is contained in:
parent
22d79165b2
commit
b8e60396b8
@ -93,7 +93,7 @@ const generateSSH = async () => {
|
|||||||
}
|
}
|
||||||
var token = localStorage.getItem("tty_token");
|
var token = localStorage.getItem("tty_token");
|
||||||
var userData = localStorage.getItem("tty_userData");
|
var userData = localStorage.getItem("tty_userData");
|
||||||
if (!token || !userData) {
|
if (!token || !userData || token == "undefined" || userData == "undefined") {
|
||||||
failMsg("Not Logged In");
|
failMsg("Not Logged In");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -125,7 +125,7 @@ const testSwal = () => {
|
|||||||
const uploadSSH = () => {
|
const uploadSSH = () => {
|
||||||
var token = localStorage.getItem("tty_token");
|
var token = localStorage.getItem("tty_token");
|
||||||
var userData = localStorage.getItem("tty_userData");
|
var userData = localStorage.getItem("tty_userData");
|
||||||
if (!token || !userData) {
|
if (!token || !userData || token == "undefined" || userData == "undefined") {
|
||||||
failMsg("Not Logged In");
|
failMsg("Not Logged In");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -206,7 +206,7 @@ const setUIData = (data) => {
|
|||||||
const checkLogin = () => {
|
const checkLogin = () => {
|
||||||
// check login status
|
// check login status
|
||||||
var token = localStorage.getItem("tty_token");
|
var token = localStorage.getItem("tty_token");
|
||||||
if (token){
|
if (token && token !== "undefined"){
|
||||||
var settings = {
|
var settings = {
|
||||||
url: USE_ORIGIN + "/auth/api/index.php",
|
url: USE_ORIGIN + "/auth/api/index.php",
|
||||||
method: "POST",
|
method: "POST",
|
||||||
|
3
index.js
3
index.js
@ -98,7 +98,8 @@ const displayFingerprints = () => {
|
|||||||
|
|
||||||
// On Page Load...
|
// On Page Load...
|
||||||
$(() => {
|
$(() => {
|
||||||
if (localStorage.getItem("tty_token")) {
|
var token = localStorage.getItem("tty_token");
|
||||||
|
if (token && token !== "undefined") {
|
||||||
window.location.href = "/auth";
|
window.location.href = "/auth";
|
||||||
}
|
}
|
||||||
// Override domain
|
// Override domain
|
||||||
|
Loading…
Reference in New Issue
Block a user