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

review(): from PR #8656 #8870

Merged
merged 10 commits into from
Dec 5, 2024
Merged

review(): from PR #8656 #8870

merged 10 commits into from
Dec 5, 2024

Conversation

AMoreaux
Copy link
Contributor

@AMoreaux AMoreaux commented Dec 4, 2024

No description provided.

# Conflicts:
#	packages/twenty-front/src/modules/auth/sign-in-up/hooks/useSignInUpForm.ts
#	packages/twenty-server/src/engine/core-modules/domain-manager/service/domain-manager.service.ts
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 implements significant changes to the authentication system, focusing on SSO integration, workspace-specific auth providers, and improved validation handling across both frontend and backend.

  • Introduces new SignInUpWorkspaceScopeFormEffect component to handle automatic auth provider selection and form progression
  • Moves favicon handling from WorkspaceProviderEffect to new dedicated PageFavicon component for better separation of concerns
  • Refactors backend auth validation with new WorkspaceAuthProvider type and isAuthEnabledOrThrow method
  • Renames validation methods for consistency (e.g., assertIsExist to assertIsDefinedOrThrow) and improves error handling
  • Contains a critical typo in method name saveDefautWorkspaceIfUserHasAccessOrThrow (missing 'l') across multiple files

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

Comment on lines +20 to +33
const checkAuthProviders = useCallback(() => {
if (
signInUpStep === SignInUpStep.Init &&
!authProviders.google &&
!authProviders.microsoft &&
!authProviders.sso
) {
return continueWithEmail();
}

if (isDefined(email) && authProviders.password) {
return continueWithCredentials();
}
}, [
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: checkAuthProviders could be called with stale email value since email is not in dependency array

# Conflicts:
#	packages/twenty-server/src/engine/core-modules/auth/services/sign-in-up.service.ts
@@ -0,0 +1 @@
export type WorkspaceAuthProvider = 'google' | 'microsoft' | 'password';
Copy link
Member

Choose a reason for hiding this comment

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

this should be in a types folder

@charlesBochet charlesBochet merged commit 33e6980 into main Dec 5, 2024
16 of 19 checks passed
@charlesBochet charlesBochet deleted the review/twenty-server branch December 5, 2024 09:46
Copy link

github-actions bot commented Dec 5, 2024

Thanks @AMoreaux for your contribution!
This marks your 17th PR on the repo. You're top 2% 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants