2
0

feat(editor): Team workspaces

This commit is contained in:
Baptiste Arnaud
2022-05-13 15:22:44 -07:00
parent 6c2986590b
commit f0fdf08b00
132 changed files with 3354 additions and 1228 deletions

View File

@ -17,9 +17,9 @@ export const getAuthenticatedGoogleClient = async (
{ client: OAuth2Client; credentials: CredentialsFromDb } | undefined
> => {
const credentials = (await prisma.credentials.findFirst({
where: { id: credentialsId, ownerId: userId },
where: { id: credentialsId, workspace: { members: { some: { userId } } } },
})) as CredentialsFromDb | undefined
if (!credentials || credentials.ownerId !== userId) return
if (!credentials) return
const data = decrypt(
credentials.data,
credentials.iv