refactor: Use http client to authenticate typeform

This commit is contained in:
Faruk AYDIN
2022-07-16 00:54:55 +03:00
parent 903b0f52b9
commit 7cf1bfffbc
2 changed files with 13 additions and 5 deletions

View File

@@ -5,14 +5,12 @@ import type {
IJSONObject,
} from '@automatisch/types';
import { URLSearchParams } from 'url';
import axios, { AxiosInstance } from 'axios';
import HttpClient from '../../helpers/http-client';
export default class Authentication implements IAuthentication {
appData: IApp;
connectionData: IJSONObject;
client: AxiosInstance = axios.create({
baseURL: 'https://api.typeform.com',
});
client: HttpClient;
scope: string[] = [
'forms:read',
@@ -27,6 +25,7 @@ export default class Authentication implements IAuthentication {
constructor(appData: IApp, connectionData: IJSONObject) {
this.connectionData = connectionData;
this.appData = appData;
this.client = new HttpClient({ baseURL: 'https://api.typeform.com' });
}
get oauthRedirectUrl() {