From 937621ee07df3adf56eff93b8d2ba2cbbf6f4580 Mon Sep 17 00:00:00 2001 From: Baptiste Arnaud Date: Thu, 21 Apr 2022 09:10:22 -0700 Subject: [PATCH] =?UTF-8?q?fix:=20=E2=8F=AA=EF=B8=8F=20Remove=20credential?= =?UTF-8?q?s=20name=20check?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../integrations/google-sheets/spreadsheets.ts | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/apps/builder/pages/api/integrations/google-sheets/spreadsheets.ts b/apps/builder/pages/api/integrations/google-sheets/spreadsheets.ts index eccc20018..dd7f16ba2 100644 --- a/apps/builder/pages/api/integrations/google-sheets/spreadsheets.ts +++ b/apps/builder/pages/api/integrations/google-sheets/spreadsheets.ts @@ -1,13 +1,8 @@ import { NextApiRequest, NextApiResponse } from 'next' import { drive } from '@googleapis/drive' import { getAuthenticatedGoogleClient } from 'libs/google-sheets' -import { - badRequest, - forbidden, - methodNotAllowed, - notAuthenticated, -} from 'utils' -import { captureException, setUser, withSentry } from '@sentry/nextjs' +import { badRequest, methodNotAllowed, notAuthenticated } from 'utils' +import { setUser, withSentry } from '@sentry/nextjs' import { getAuthenticatedUser } from 'services/api/utils' const handler = async (req: NextApiRequest, res: NextApiResponse) => { @@ -22,14 +17,6 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => { if (!auth) return res.status(404).send("Couldn't find credentials in database") console.log(auth.credentials.name, user.email) - if (auth.credentials.name !== user.email) { - captureException( - new Error( - `Credentials name does not match user email ${auth?.credentials.name} !== ${user.email}` - ) - ) - return forbidden(res) - } const response = await drive({ version: 'v3', auth: auth.client,