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:
Thomas Lamprecht 2021-07-03 23:12:03 +02:00
parent 34bd1109b0
commit dc99315cf9
1 changed files with 4 additions and 9 deletions

View File

@ -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);
} }