[pve-devel] [PATCH widget-toolkit] return cookie again in authOK
Dominik Csapak
d.csapak at proxmox.com
Mon May 25 13:46:54 CEST 2020
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 at proxmox.com>
---
Utils.js | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/Utils.js b/Utils.js
index cae25b2..402349a 100644
--- 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() {
--
2.20.1
More information about the pve-devel
mailing list