-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 #9033 (comment)
- Loading branch information
Showing
78 changed files
with
1,146 additions
and
1,240 deletions.
There are no files selected for viewing
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
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
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,10 @@ export const SIGN_UP = gql` | |
loginToken { | ||
...AuthTokenFragment | ||
} | ||
workspace { | ||
id | ||
subdomain | ||
} | ||
} | ||
} | ||
`; |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import { | ||
ChallengeDocument, | ||
GetCurrentUserDocument, | ||
SignUpDocument, | ||
VerifyDocument, | ||
} from '~/generated/graphql'; | ||
|
@@ -8,6 +9,7 @@ export const queries = { | |
challenge: ChallengeDocument, | ||
verify: VerifyDocument, | ||
signup: SignUpDocument, | ||
getCurrentUser: GetCurrentUserDocument, | ||
}; | ||
|
||
export const email = '[email protected]'; | ||
|
@@ -22,6 +24,7 @@ export const variables = { | |
}, | ||
verify: { loginToken: token }, | ||
signup: {}, | ||
getCurrentUser: {}, | ||
}; | ||
|
||
export const results = { | ||
|
@@ -32,7 +35,14 @@ export const results = { | |
}, | ||
}, | ||
verify: { | ||
user: { | ||
tokens: { | ||
accessToken: { token, expiresAt: 'expiresAt' }, | ||
refreshToken: { token, expiresAt: 'expiresAt' }, | ||
}, | ||
}, | ||
signUp: { loginToken: { token, expiresAt: 'expiresAt' } }, | ||
getCurrentUser: { | ||
currentUser: { | ||
id: 'id', | ||
firstName: 'firstName', | ||
lastName: 'lastName', | ||
|
@@ -49,7 +59,7 @@ export const results = { | |
avatarUrl: 'avatarUrl', | ||
locale: 'locale', | ||
}, | ||
defaultWorkspace: { | ||
currentWorkspace: { | ||
id: 'id', | ||
displayName: 'displayName', | ||
logo: 'logo', | ||
|
@@ -65,13 +75,7 @@ export const results = { | |
}, | ||
}, | ||
}, | ||
tokens: { | ||
accessToken: { token, expiresAt: 'expiresAt' }, | ||
refreshToken: { token, expiresAt: 'expiresAt' }, | ||
}, | ||
signup: {}, | ||
}, | ||
signUp: { loginToken: { token, expiresAt: 'expiresAt' } }, | ||
}; | ||
|
||
export const mocks = [ | ||
|
@@ -108,4 +112,13 @@ export const mocks = [ | |
}, | ||
})), | ||
}, | ||
{ | ||
request: { | ||
query: queries.getCurrentUser, | ||
variables: variables.getCurrentUser, | ||
}, | ||
result: jest.fn(() => ({ | ||
data: results.getCurrentUser, | ||
})), | ||
}, | ||
]; |
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
Oops, something went wrong.