ui: app: fix openID helper usage and rework style
one really does not need a if and an extra intermediate variable for assigning a simple bool... Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
34bd1109b0
commit
dc99315cf9
|
@ -49,16 +49,11 @@ Ext.define('PBS.Application', {
|
||||||
var provider = new Ext.state.LocalStorageProvider({ prefix: 'ext-pbs-' });
|
var provider = new Ext.state.LocalStorageProvider({ prefix: 'ext-pbs-' });
|
||||||
Ext.state.Manager.setProvider(provider);
|
Ext.state.Manager.setProvider(provider);
|
||||||
|
|
||||||
let openid_login = false;
|
let isOpenIDLogin = Proxmox.Utils.getOpenIDRedirectionAuthorization() !== undefined;
|
||||||
let param = PBS.Utils.openid_login_param();
|
let alreadyLoggedIn = Proxmox.Utils.authOK();
|
||||||
if (param !== undefined) {
|
|
||||||
openid_login = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// show login window if not loggedin
|
if (isOpenIDLogin || !alreadyLoggedIn) {
|
||||||
var loggedin = Proxmox.Utils.authOK();
|
me.changeView('loginview', true); // show login window if not loggedin
|
||||||
if (openid_login || !loggedin) {
|
|
||||||
me.changeView('loginview', true);
|
|
||||||
} else {
|
} else {
|
||||||
me.changeView('mainview', true);
|
me.changeView('mainview', true);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue