From c386b001ba9ed21edad1ef69127618a12240d145 Mon Sep 17 00:00:00 2001 From: Ali BARIN Date: Thu, 3 Nov 2022 20:16:57 +0100 Subject: [PATCH] refactor(github): remove getTokenInfo function --- .../apps/github/auth/verify-credentials.ts | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/packages/backend/src/apps/github/auth/verify-credentials.ts b/packages/backend/src/apps/github/auth/verify-credentials.ts index 6c0e7d57..259df592 100644 --- a/packages/backend/src/apps/github/auth/verify-credentials.ts +++ b/packages/backend/src/apps/github/auth/verify-credentials.ts @@ -1,26 +1,6 @@ import { IGlobalVariable } from '@automatisch/types'; import getCurrentUser from '../common/get-current-user'; -async function getTokenInfo($: IGlobalVariable) { - const basicAuthToken = Buffer.from( - $.auth.data.consumerKey + ':' + $.auth.data.consumerSecret - ).toString('base64'); - - const headers = { - Authorization: `Basic ${basicAuthToken}`, - }; - - const body = { - access_token: $.auth.data.accessToken, - }; - - return await $.http.post( - `${$.app.baseUrl}/applications/${$.auth.data.consumerKey}/token`, - body, - { headers } - ); -} - const verifyCredentials = async ($: IGlobalVariable) => { try { const response = await $.http.post(