feat: implement user impersonation feature (#976)

* feat: wip impersonate user

* feat: add ability to impersonate an user

* fix: remove console.log

* fix: unused import
This commit is contained in:
Jérémy M
2023-08-01 00:47:29 +02:00
committed by GitHub
parent b028d9fd2a
commit f111440e00
24 changed files with 547 additions and 30 deletions

View File

@ -39,8 +39,10 @@ export const VERIFY = gql`
displayName
firstName
lastName
canImpersonate
workspaceMember {
id
allowImpersonation
workspace {
id
domainName
@ -85,3 +87,45 @@ export const RENEW_TOKEN = gql`
}
}
`;
// TODO: Fragments should be used instead of duplicating the user fields !
export const IMPERSONATE = gql`
mutation Impersonate($userId: String!) {
impersonate(userId: $userId) {
user {
id
email
displayName
firstName
lastName
canImpersonate
workspaceMember {
id
allowImpersonation
workspace {
id
domainName
displayName
logo
inviteHash
}
}
settings {
id
colorScheme
locale
}
}
tokens {
accessToken {
token
expiresAt
}
refreshToken {
token
expiresAt
}
}
}
}
`;