mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-07-15 17:37:32 +00:00
fix bug #86: correctly decode cookie
This commit is contained in:
parent
56ecfafd03
commit
e771ec500a
@ -18,6 +18,7 @@ use HTML::Entities;
|
|||||||
use PVE::JSONSchema;
|
use PVE::JSONSchema;
|
||||||
use PVE::AccessControl;
|
use PVE::AccessControl;
|
||||||
use PVE::RPCEnvironment;
|
use PVE::RPCEnvironment;
|
||||||
|
use URI::Escape;
|
||||||
|
|
||||||
use Data::Dumper; # fixme: remove
|
use Data::Dumper; # fixme: remove
|
||||||
|
|
||||||
@ -44,7 +45,13 @@ sub extract_auth_cookie {
|
|||||||
|
|
||||||
return undef if !$cookie;
|
return undef if !$cookie;
|
||||||
|
|
||||||
return ($cookie =~ /(?:^|\s)$cookie_name=([^;]*)/)[0];
|
my $ticket = ($cookie =~ /(?:^|\s)$cookie_name=([^;]*)/)[0];
|
||||||
|
|
||||||
|
if ($ticket && $ticket =~ m/^PVE%3A/) {
|
||||||
|
$ticket = uri_unescape($ticket);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $ticket;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub create_auth_cookie {
|
sub create_auth_cookie {
|
||||||
|
2
debian/changelog.Debian
vendored
2
debian/changelog.Debian
vendored
@ -2,6 +2,8 @@ pve-manager (2.0-20) unstable; urgency=low
|
|||||||
|
|
||||||
* fix bug #85: allow root@pam to generate tickets for other users
|
* fix bug #85: allow root@pam to generate tickets for other users
|
||||||
|
|
||||||
|
* fix bug #86: correctly decode cookie
|
||||||
|
|
||||||
-- Proxmox Support Team <support@proxmox.com> Tue, 17 Jan 2012 06:36:23 +0100
|
-- Proxmox Support Team <support@proxmox.com> Tue, 17 Jan 2012 06:36:23 +0100
|
||||||
|
|
||||||
pve-manager (2.0-19) unstable; urgency=low
|
pve-manager (2.0-19) unstable; urgency=low
|
||||||
|
@ -26,6 +26,8 @@ Ext.define('PVE.Workspace', {
|
|||||||
me.loginData = loginData;
|
me.loginData = loginData;
|
||||||
PVE.CSRFPreventionToken = loginData.CSRFPreventionToken;
|
PVE.CSRFPreventionToken = loginData.CSRFPreventionToken;
|
||||||
PVE.UserName = loginData.username;
|
PVE.UserName = loginData.username;
|
||||||
|
var expire = Ext.Date.add(new Date(), Ext.Date.HOUR, 2);
|
||||||
|
Ext.util.Cookies.set('PVEAuthCookie', loginData.ticket, expire);
|
||||||
me.onLogin(loginData);
|
me.onLogin(loginData);
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -88,7 +90,6 @@ Ext.define('PVE.Workspace', {
|
|||||||
url: '/api2/json/access/ticket',
|
url: '/api2/json/access/ticket',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
success: function(response, opts) {
|
success: function(response, opts) {
|
||||||
// cookie is automatically updated
|
|
||||||
var obj = Ext.decode(response.responseText);
|
var obj = Ext.decode(response.responseText);
|
||||||
me.updateLoginData(obj.data);
|
me.updateLoginData(obj.data);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user