From d6e0e7c9bc613ebf7387687d1451783aa4519f48 Mon Sep 17 00:00:00 2001 From: MTG2000 Date: Thu, 2 Jun 2022 15:39:57 +0300 Subject: [PATCH] remove logs --- functions/graphql/index.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/functions/graphql/index.js b/functions/graphql/index.js index 755a958..c31bbef 100644 --- a/functions/graphql/index.js +++ b/functions/graphql/index.js @@ -5,20 +5,13 @@ const jose = require('jose'); const { CONSTS } = require('../utils'); const extractKey = async (cookieHeader) => { - - console.log('START'); - - console.log(cookieHeader); const cookies = cookie.parse(cookieHeader ?? ''); const authToken = cookies.Authorization; - console.log(authToken); if (authToken) { const token = authToken.split(' ')[1]; const { payload } = await jose.jwtVerify(token, Buffer.from(CONSTS.JWT_SECRET), { algorithms: ['HS256'], }) - - console.log(payload); return payload.pubKey } return null; @@ -28,7 +21,7 @@ const extractKey = async (cookieHeader) => { const server = new ApolloServer({ schema, context: async ({ event }) => { - const userPubKey = await extractKey(event.headers.cookie) + const userPubKey = await extractKey(event.headers.cookie ?? event.headers.Cookie) return { userPubKey } }, });