]> git.proxmox.com Git - proxmox-widget-toolkit.git/commitdiff
return cookie again in authOK
authorDominik Csapak <d.csapak@proxmox.com>
Mon, 25 May 2020 11:46:54 +0000 (13:46 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 25 May 2020 11:51:30 +0000 (13:51 +0200)
the calling code did require that authOK returns the cookie if
there is a valid one

make it now very explicit that the cookie gets returned instead
of using implicit short-circuit behaviour

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Utils.js

index cae25b231efcb74cd9da48355a01aa76cc1ee544..402349a5cda91968c6662534f21671edacc7962c 100644 (file)
--- a/Utils.js
+++ b/Utils.js
@@ -208,7 +208,11 @@ Ext.define('Proxmox.Utils', { utilities: {
            return undefined;
        }
        let cookie = Ext.util.Cookies.get(Proxmox.Setup.auth_cookie_name);
-       return (Proxmox.UserName !== '') && (cookie && !cookie.startsWith("PVE:tfa!"));
+       if (Proxmox.UserName !== '' && cookie && !cookie.startsWith("PVE:tfa!")) {
+           return cookie;
+       } else {
+           return false;
+       }
     },
 
     authClear: function() {