Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(auth): update SSO provider selection logic #9975

Merged
merged 1 commit into from
Feb 3, 2025

Conversation

AMoreaux
Copy link
Contributor

@AMoreaux AMoreaux commented Feb 3, 2025

Refined the logic to check for SSO providers before setting the sign-in step. Consolidated conditions to ensure clarity and avoid redundant checks.

Refined the logic to check for SSO providers before setting the sign-in step. Consolidated conditions to ensure clarity and avoid redundant checks.
@AMoreaux AMoreaux enabled auto-merge (squash) February 3, 2025 14:04
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

This PR refactors the SSO provider selection logic in the authentication flow, improving the handling of multiple SSO providers and authentication methods.

  • Modified SignInUpWorkspaceScopeFormEffect.tsx to check for SSO-only authentication before evaluating provider count, preventing unnecessary SSO selection steps
  • Added explicit condition hasOnlySSOProvidersEnabled to ensure SSO selection only appears when it's the sole authentication method
  • Improved auto-redirect logic when single SSO provider is available and no other auth methods exist

1 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile

Comment on lines 50 to 53
const hasOnlySSOProvidersEnabled =
!workspaceAuthProviders.google &&
!workspaceAuthProviders.microsoft &&
!workspaceAuthProviders.password;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: consider extracting hasOnlySSOProvidersEnabled into a reusable function since it's a core auth flow check

@AMoreaux AMoreaux merged commit eb0762d into main Feb 3, 2025
47 checks passed
@AMoreaux AMoreaux deleted the fix/sign-in-up-modal branch February 3, 2025 14:12
Copy link

github-actions bot commented Feb 3, 2025

Thanks @AMoreaux for your contribution!
This marks your 72nd PR on the repo. You're top 1% of all our contributors 🎉
See contributor page - Share on LinkedIn - Share on Twitter

Contributions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants