feat(editor): ✨ Team workspaces
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user