refacto(*): remove everything about default workspace (#9157)
## Summary - [x] Remove defaultWorkspace in user - [x] Remove all occurrence of defaultWorkspace and defaultWorkspaceId - [x] Improve activate workspace flow - [x] Improve security on social login - [x] Add `ImpersonateGuard` - [x] Allow to use impersonation with couple `User/Workspace` - [x] Prevent unexpected reload on activate workspace - [x] Scope login token with workspaceId Fix https://github.com/twentyhq/twenty/issues/9033#event-15714863042
This commit is contained in:
@ -52,7 +52,10 @@ export const UserProviderEffect = () => {
|
||||
if (!isDefined(queryData?.currentUser)) return;
|
||||
|
||||
setCurrentUser(queryData.currentUser);
|
||||
setCurrentWorkspace(queryData.currentUser.defaultWorkspace);
|
||||
|
||||
if (isDefined(queryData.currentUser.currentWorkspace)) {
|
||||
setCurrentWorkspace(queryData.currentUser.currentWorkspace);
|
||||
}
|
||||
|
||||
const {
|
||||
workspaceMember,
|
||||
|
||||
@ -24,7 +24,7 @@ export const USER_QUERY_FRAGMENT = gql`
|
||||
workspaceMembers {
|
||||
...WorkspaceMemberQueryFragment
|
||||
}
|
||||
defaultWorkspace {
|
||||
currentWorkspace {
|
||||
id
|
||||
displayName
|
||||
logo
|
||||
|
||||
Reference in New Issue
Block a user