mirror of
https://github.com/twentyhq/twenty.git
synced 2024-12-23 03:51:36 +03:00
07bde4883e
Introduce `defaultWorkspaceId` to improve workspace redirection logic. Updated GraphQL schema, server logic, and frontend components accordingly to prioritize default workspaces when available. ## Summary This PR adds a mechanism to handle and prioritize default workspace selection for users during authentication. It updates the logic in multiple components and services to ensure users are redirected to their default workspaces if no specific selection is provided. ### Main changes: - **GraphQL Schema Updates**: - Enhanced `UserExists` GraphQL entity with a new `defaultWorkspaceId` field to specify the user's default workspace. - Updated queries and mutations to handle the `defaultWorkspaceId`. - **Client-Side Updates**: - Enhanced `useAuth` hook to include logic for managing default workspace redirection. - Adjusted UI logic in `SignInUpGlobalScopeForm` to utilize the `defaultWorkspaceId`. - **Server-Side Adjustments**: - Modified `AuthService` to include `defaultWorkspaceId` in `checkUserExists`. - Default workspace logic added to the backend flow for consistent handling. - **Tests/Helpers**: - Added utility and type changes to integrate the new backend response changes (e.g., `UserExists` GraphQL). - **Subsequent function lifecycle** was adjusted to include recheck for workspace token states when performing sign-in flows. |
||
---|---|---|
.. | ||
@types | ||
patches | ||
scripts | ||
src | ||
test/integration | ||
.env.example | ||
.env.test | ||
.eslintrc.cjs | ||
.gitignore | ||
.prettierignore | ||
.prettierrc | ||
.swcrc | ||
jest-integration.config.ts | ||
jest.config.ts | ||
nest-cli.json | ||
package.json | ||
project.json | ||
tsconfig.build.json | ||
tsconfig.json | ||
tsconfig.scripts.json |