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 userData = localStorage.getItem("tty_userData");
|
||||
if (!token || !userData) {
|
||||
if (!token || !userData || token == "undefined" || userData == "undefined") {
|
||||
failMsg("Not Logged In");
|
||||
return;
|
||||
}
|
||||
@ -125,7 +125,7 @@ const testSwal = () => {
|
||||
const uploadSSH = () => {
|
||||
var token = localStorage.getItem("tty_token");
|
||||
var userData = localStorage.getItem("tty_userData");
|
||||
if (!token || !userData) {
|
||||
if (!token || !userData || token == "undefined" || userData == "undefined") {
|
||||
failMsg("Not Logged In");
|
||||
return;
|
||||
}
|
||||
@ -206,7 +206,7 @@ const setUIData = (data) => {
|
||||
const checkLogin = () => {
|
||||
// check login status
|
||||
var token = localStorage.getItem("tty_token");
|
||||
if (token){
|
||||
if (token && token !== "undefined"){
|
||||
var settings = {
|
||||
url: USE_ORIGIN + "/auth/api/index.php",
|
||||
method: "POST",
|
||||
|
Loading…
Reference in New Issue
Block a user