ui: re-new ticket every 15 minutes
Like we do it in PVE/PMG Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
6cc8abbbd5
commit
a602faeb98
@ -100,6 +100,33 @@ Ext.define('PBS.MainView', {
|
||||
var me = this;
|
||||
|
||||
me.lookupReference('usernameinfo').update({username:Proxmox.UserName});
|
||||
|
||||
// get ticket periodically
|
||||
Ext.TaskManager.start({
|
||||
run: function() {
|
||||
var ticket = Proxmox.Utils.authOK();
|
||||
if (!ticket || !Proxmox.UserName) {
|
||||
return;
|
||||
}
|
||||
|
||||
Ext.Ajax.request({
|
||||
params: {
|
||||
username: Proxmox.UserName,
|
||||
password: ticket
|
||||
},
|
||||
url: '/api2/json/access/ticket',
|
||||
method: 'POST',
|
||||
failure: function() {
|
||||
me.logout();
|
||||
},
|
||||
success: function(response, opts) {
|
||||
var obj = Ext.decode(response.responseText);
|
||||
PMG.Utils.updateLoginData(obj.data);
|
||||
}
|
||||
});
|
||||
},
|
||||
interval: 15*60*1000
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user