Utils.js: fix cookie handling

Use unsecure cookie foör testing.
This commit is contained in:
Dietmar Maurer 2019-01-31 10:08:08 +01:00
parent 9f49fe1d5d
commit f484eed3c2
2 changed files with 4 additions and 3 deletions

View File

@ -295,8 +295,6 @@ fn get_index() -> BoxFut {
let resp = Response::builder() let resp = Response::builder()
.status(StatusCode::OK) .status(StatusCode::OK)
.header(header::CONTENT_TYPE, "text/html") .header(header::CONTENT_TYPE, "text/html")
// emulate succssful login, so that Proxmox:Utils.authOk() returns true
.header(header::SET_COOKIE, "PBSAuthCookie=\"XXX\"") // fixme: remove
.body(index.into()) .body(index.into())
.unwrap(); .unwrap();

View File

@ -9,7 +9,10 @@ Ext.define('PBS.Utils', {
updateLoginData: function(data) { updateLoginData: function(data) {
Proxmox.CSRFPreventionToken = data.CSRFPreventionToken; Proxmox.CSRFPreventionToken = data.CSRFPreventionToken;
Proxmox.UserName = data.username; Proxmox.UserName = data.username;
Ext.util.Cookies.set('PBSAuthCookie', data.ticket, null, '/', null, true ); console.log(data.ticket);
// fixme: use secure flag once we have TLS
//Ext.util.Cookies.set('PBSAuthCookie', data.ticket, null, '/', null, true );
Ext.util.Cookies.set('PBSAuthCookie', data.ticket, null, '/', null, false);
}, },
constructor: function() { constructor: function() {