Skip to content

Commit da5495f

Browse files
Set SSO as default if sso providers were present (#1730)
1 parent 40032cb commit da5495f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/shared/modules/connections/connectionsDuck.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,12 +563,20 @@ export const startupConnectEpic = (action$: any, store: any) => {
563563
}
564564
}
565565

566+
const currentConn = getConnection(
567+
store.getState(),
568+
discovery.CONNECTION_ID
569+
)
566570
// Otherwise fail autoconnect
567571
store.dispatch(setActiveConnection(null))
568572
store.dispatch(
569573
discovery.updateDiscoveryConnection({
570574
password: '',
571-
SSOError: discovered?.SSOError
575+
SSOError: discovered?.SSOError,
576+
authenticationMethod:
577+
(currentConn?.SSOProviders?.length ?? 0) > 1
578+
? SSO
579+
: currentConn?.authenticationMethod
572580
})
573581
)
574582
return Promise.resolve({ type: STARTUP_CONNECTION_FAILED })

0 commit comments

Comments
 (0)