diff --git a/src/views/Login.vue b/src/views/Login.vue index f65c7a8..e7b2fcd 100644 --- a/src/views/Login.vue +++ b/src/views/Login.vue @@ -206,13 +206,18 @@ export default defineComponent({ // run SAML login flow if login options are configured for the OMS await this.fetchLoginOptions() - if (this.loginOption.loginAuthType !== 'BASIC') { + + // checking loginOption.length to know if fetchLoginOptions API returned data + // as toggleOmsInput is called twice without this check, from fetchLoginOptions and + // through setOms (here) again + if (Object.keys(this.loginOption).length && this.loginOption.loginAuthType !== 'BASIC') { window.location.href = `${this.loginOption.loginAuthUrl}?relaystate=${window.location.origin}/login` // passing launchpad/login URL } else { this.toggleOmsInput() } }, async fetchLoginOptions() { + this.loginOption = {} try { const resp = await UserService.checkLoginOptions() if (!hasError(resp)) { @@ -220,8 +225,6 @@ export default defineComponent({ } } catch (error) { console.error(error) - // Fallback TODO Remove this - this.toggleOmsInput() } }, async login() {