Skip to content

Commit

Permalink
Set SSO as default if sso providers were present (#1730)
Browse files Browse the repository at this point in the history
  • Loading branch information
OskarDamkjaer authored Apr 12, 2022
1 parent 40032cb commit da5495f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/shared/modules/connections/connectionsDuck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -563,12 +563,20 @@ export const startupConnectEpic = (action$: any, store: any) => {
}
}

const currentConn = getConnection(
store.getState(),
discovery.CONNECTION_ID
)
// Otherwise fail autoconnect
store.dispatch(setActiveConnection(null))
store.dispatch(
discovery.updateDiscoveryConnection({
password: '',
SSOError: discovered?.SSOError
SSOError: discovered?.SSOError,
authenticationMethod:
(currentConn?.SSOProviders?.length ?? 0) > 1
? SSO
: currentConn?.authenticationMethod
})
)
return Promise.resolve({ type: STARTUP_CONNECTION_FAILED })
Expand Down

0 comments on commit da5495f

Please sign in to comment.