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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (workspaceAuthProviders.sso.length > 1) {
|
|
||||||
return setSignInUpStep(SignInUpStep.SSOIdentityProviderSelection);
|
|
||||||
}
|
|
||||||
|
|
||||||
const hasOnlySSOProvidersEnabled =
|
const hasOnlySSOProvidersEnabled =
|
||||||
!workspaceAuthProviders.google &&
|
!workspaceAuthProviders.google &&
|
||||||
!workspaceAuthProviders.microsoft &&
|
!workspaceAuthProviders.microsoft &&
|
||||||
!workspaceAuthProviders.password;
|
!workspaceAuthProviders.password;
|
||||||
|
|
||||||
|
if (hasOnlySSOProvidersEnabled && workspaceAuthProviders.sso.length > 1) {
|
||||||
|
return setSignInUpStep(SignInUpStep.SSOIdentityProviderSelection);
|
||||||
|
}
|
||||||
|
|
||||||
if (hasOnlySSOProvidersEnabled && workspaceAuthProviders.sso.length === 1) {
|
if (hasOnlySSOProvidersEnabled && workspaceAuthProviders.sso.length === 1) {
|
||||||
redirectToSSOLoginPage(workspaceAuthProviders.sso[0].id);
|
redirectToSSOLoginPage(workspaceAuthProviders.sso[0].id);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user