Skip to content

Commit

Permalink
Merge pull request #48 from k2maan/launchpad/#44
Browse files Browse the repository at this point in the history
Fixed: SAML redirection error in case of unconfigured OMS (checkLoginOptions not available on the instance) (#44)
  • Loading branch information
ravilodhi authored Sep 13, 2023
2 parents dfa1761 + 7f57034 commit d1bd240
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/views/Login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -206,22 +206,25 @@ 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)) {
this.loginOption = resp.data
}
} catch (error) {
console.error(error)

Check warning on line 227 in src/views/Login.vue

View workflow job for this annotation

GitHub Actions / call-workflow-in-another-repo / reusable_workflow_job (16.x)

Unexpected console statement
// Fallback TODO Remove this
this.toggleOmsInput()
}
},
async login() {
Expand Down

0 comments on commit d1bd240

Please sign in to comment.