refactor(auth): update SSO provider selection logic (#9975)
Refined the logic to check for SSO providers before setting the sign-in step. Consolidated conditions to ensure clarity and avoid redundant checks.
This commit is contained in:
@ -47,15 +47,15 @@ export const SignInUpWorkspaceScopeFormEffect = () => {
|
||||
return;
|
||||
}
|
||||
|
||||
if (workspaceAuthProviders.sso.length > 1) {
|
||||
return setSignInUpStep(SignInUpStep.SSOIdentityProviderSelection);
|
||||
}
|
||||
|
||||
const hasOnlySSOProvidersEnabled =
|
||||
!workspaceAuthProviders.google &&
|
||||
!workspaceAuthProviders.microsoft &&
|
||||
!workspaceAuthProviders.password;
|
||||
|
||||
if (hasOnlySSOProvidersEnabled && workspaceAuthProviders.sso.length > 1) {
|
||||
return setSignInUpStep(SignInUpStep.SSOIdentityProviderSelection);
|
||||
}
|
||||
|
||||
if (hasOnlySSOProvidersEnabled && workspaceAuthProviders.sso.length === 1) {
|
||||
redirectToSSOLoginPage(workspaceAuthProviders.sso[0].id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user