-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
feat(auth): refactor auth + allow to configure auth methods by workspace #8654
Open
AMoreaux
wants to merge
15
commits into
feat/add-is-multi-workspace-flag
Choose a base branch
from
feat/allow-to-select-auth-methods-by-workspace
base: feat/add-is-multi-workspace-flag
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat(auth): refactor auth + allow to configure auth methods by workspace #8654
AMoreaux
wants to merge
15
commits into
feat/add-is-multi-workspace-flag
from
feat/allow-to-select-auth-methods-by-workspace
+2,109
−1,252
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…t-auth-methods-by-workspace # Conflicts: # packages/twenty-front/src/modules/auth/sign-in-up/components/SignInUpForm.tsx # packages/twenty-front/src/modules/auth/sign-in-up/hooks/useSignInUpForm.ts
Remove unused imports from SignInUpGlobalScopeForm.tsx to improve code readability and reduce clutter. This change simplifies the module by eliminating unnecessary dependencies.
Suppress eslint warnings for console.error in error handling. This ensures cleaner code and maintains log output for better debugging.
Correct the expected state in useAuth test to reflect the accurate status of authProviders. This includes setting 'google' and 'password' to true, and initializing 'sso' as an empty array.
TODOs/FIXMEs:
|
There was a problem hiding this 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 workspace-specific authentication configuration, replacing the global auth settings with per-workspace controls for Google, Microsoft, Password, and SSO authentication methods.
- Added
isGoogleAuthEnabled
,isMicrosoftAuthEnabled
,isPasswordAuthEnabled
fields to/packages/twenty-server/src/engine/core-modules/workspace/workspace.entity.ts
for per-workspace auth control - Replaced global
IS_SIGN_UP_DISABLED
withIS_MULTIWORKSPACE_ENABLED
in server environment variables to support subdomain-based workspace access - Added new
WorkspaceProviderEffect
component in/packages/twenty-front/src/modules/workspace/components/WorkspaceProviderEffect.tsx
to manage workspace-specific auth state - Added
getPublicWorkspaceDataBySubdomain
query in workspace resolver to fetch workspace-specific auth configuration - Implemented SSO identity provider management with new types and mutations in
/packages/twenty-server/src/engine/core-modules/sso/
for OIDC and SAML support
88 file(s) reviewed, 66 comment(s)
Edit PR Review Bot Settings | Greptile
packages/twenty-front/src/modules/auth/graphql/queries/getPublicWorkspaceDataBySubdomain.ts
Show resolved
Hide resolved
packages/twenty-front/src/modules/auth/sign-in-up/components/SignInUpEmailField.tsx
Show resolved
Hide resolved
packages/twenty-front/src/modules/auth/sign-in-up/components/SignInUpGlobalScopeForm.tsx
Outdated
Show resolved
Hide resolved
packages/twenty-front/src/modules/auth/sign-in-up/components/SignInUpGlobalScopeForm.tsx
Show resolved
Hide resolved
packages/twenty-server/src/engine/core-modules/workspace/workspace.exception.ts
Outdated
Show resolved
Hide resolved
packages/twenty-server/src/engine/core-modules/workspace/workspace.resolver.ts
Outdated
Show resolved
Hide resolved
AMoreaux
changed the base branch from
main
to
feat/add-is-multi-workspace-flag
November 21, 2024 16:33
…lect-auth-methods-by-workspace
…lect-auth-methods-by-workspace # Conflicts: # packages/twenty-front/src/generated/graphql.tsx
Updated SSO identity provider type and added types for workspace queries. Removed deprecated mutations and queries related to SSO identity providers and JWT generation. Added new fields and types to support improved workspace querying and switching capabilities.
Move import of workspaceValidator to maintain consistent import structure. This enhances readability and aligns with the project's import organization standards.
Removed unused imports from SignInUpGlobalScopeForm and SettingsSecurityOptionsList components. This cleanup improves code readability and reduces potential maintenance overhead.
Added `GET_PUBLIC_WORKSPACE_DATA_BY_SUBDOMAIN` query mock handler to return mock workspace data. Also updated the button text check in SignInUp stories for consistency.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.