From 7c58f011caf5c44e2518b6eaf18a6846b2d0c792 Mon Sep 17 00:00:00 2001 From: Masahiko AMANO Date: Fri, 27 Jan 2023 17:00:35 +0300 Subject: [PATCH] fix(web): fix token.js --- web/public/js/token.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/web/public/js/token.js b/web/public/js/token.js index f71e724..5c5e860 100644 --- a/web/public/js/token.js +++ b/web/public/js/token.js @@ -2,6 +2,7 @@ $(window).on("load", function () { let authorized = true; if ($.cookie("token") == null) { authorized = false; + } else { $.ajax({ url: "/token", type: "POST", @@ -9,9 +10,7 @@ $(window).on("load", function () { data: `{"token":"${$.cookie("token")}"}`, dataType: "json", success: function (resp) { - if (resp.status) { - authorized = true; - } + authorized = resp.status; }, failure: function (err) { alert(err);