diff --git a/apps/builder/src/features/auth/helpers/getAuthenticatedUser.ts b/apps/builder/src/features/auth/helpers/getAuthenticatedUser.ts index 7e09014966..269fc0e896 100644 --- a/apps/builder/src/features/auth/helpers/getAuthenticatedUser.ts +++ b/apps/builder/src/features/auth/helpers/getAuthenticatedUser.ts @@ -20,7 +20,7 @@ export const getAuthenticatedUser = async ( | User | undefined) if (!user || !('id' in user)) return - setUser({ id: user.id, email: user.email ?? undefined }) + setUser({ id: user.id }) return user } @@ -31,7 +31,7 @@ const authenticateByToken = async ( const user = (await prisma.user.findFirst({ where: { apiTokens: { some: { token: apiToken } } }, })) as User - setUser({ id: user.id, email: user.email ?? undefined }) + setUser({ id: user.id }) return user } diff --git a/apps/builder/src/pages/api/integrations/google-sheets/spreadsheets.ts b/apps/builder/src/pages/api/integrations/google-sheets/spreadsheets.ts index 6a8bd7629c..e030e26506 100644 --- a/apps/builder/src/pages/api/integrations/google-sheets/spreadsheets.ts +++ b/apps/builder/src/pages/api/integrations/google-sheets/spreadsheets.ts @@ -13,7 +13,7 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => { const user = await getAuthenticatedUser(req, res) if (!user) return notAuthenticated(res) - setUser({ email: user.email ?? undefined, id: user.id }) + setUser({ id: user.id }) if (req.method === 'GET') { const credentialsId = req.query.credentialsId as string | undefined if (!credentialsId) return badRequest(res) diff --git a/apps/builder/src/pages/api/integrations/google-sheets/spreadsheets/[id]/sheets.ts b/apps/builder/src/pages/api/integrations/google-sheets/spreadsheets/[id]/sheets.ts index 3fe71b76f1..5010d427d3 100644 --- a/apps/builder/src/pages/api/integrations/google-sheets/spreadsheets/[id]/sheets.ts +++ b/apps/builder/src/pages/api/integrations/google-sheets/spreadsheets/[id]/sheets.ts @@ -14,7 +14,7 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => { const user = await getAuthenticatedUser(req, res) if (!user) return notAuthenticated(res) - setUser({ email: user.email ?? undefined, id: user.id }) + setUser({ id: user.id }) if (req.method === 'GET') { const credentialsId = req.query.credentialsId as string | undefined if (!credentialsId) return badRequest(res)