Refactor integrations logic and replace hardcoded client ids with envars

This commit is contained in:
Tuan Dang
2022-12-18 12:18:50 -05:00
parent 516819507a
commit 547555591b
17 changed files with 144 additions and 42 deletions
+2 -2
View File
@@ -11,7 +11,7 @@ import {
} from '../variables';
import {
SITE_URL,
OAUTH_CLIENT_SECRET_HEROKU,
CLIENT_SECRET_HEROKU,
CLIENT_ID_VERCEL,
CLIENT_ID_NETLIFY,
CLIENT_SECRET_VERCEL,
@@ -114,7 +114,7 @@ const exchangeCodeHeroku = async ({
new URLSearchParams({
grant_type: 'authorization_code',
code: code,
client_secret: OAUTH_CLIENT_SECRET_HEROKU
client_secret: CLIENT_SECRET_HEROKU
} as any)
)).data;
+2 -2
View File
@@ -2,7 +2,7 @@ import axios from 'axios';
import * as Sentry from '@sentry/node';
import { INTEGRATION_HEROKU } from '../variables';
import {
OAUTH_CLIENT_SECRET_HEROKU
CLIENT_SECRET_HEROKU
} from '../config';
import {
INTEGRATION_HEROKU_TOKEN_URL
@@ -59,7 +59,7 @@ const exchangeRefreshHeroku = async ({
new URLSearchParams({
grant_type: 'refresh_token',
refresh_token: refreshToken,
client_secret: OAUTH_CLIENT_SECRET_HEROKU
client_secret: CLIENT_SECRET_HEROKU
} as any)
);