From 7eece27a288b1b05e6d56f60cc3d57c4b1e87f4c Mon Sep 17 00:00:00 2001 From: Oskar Damkjaer Date: Tue, 12 Apr 2022 10:20:31 +0200 Subject: [PATCH] Set SSO as default if sso providers were present --- src/shared/modules/connections/connectionsDuck.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/shared/modules/connections/connectionsDuck.ts b/src/shared/modules/connections/connectionsDuck.ts index cc727f8aee0..d92296ec31b 100644 --- a/src/shared/modules/connections/connectionsDuck.ts +++ b/src/shared/modules/connections/connectionsDuck.ts @@ -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 })