refactor: Pass connection, flow and step as params to apps
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import type { IAuthentication, IField } from '@automatisch/types';
|
||||
import type { IAuthentication, IField, IApp } from '@automatisch/types';
|
||||
import { URLSearchParams } from 'url';
|
||||
import TwitterClient from './client';
|
||||
|
||||
@@ -10,7 +10,7 @@ export default class Authentication implements IAuthentication {
|
||||
}
|
||||
|
||||
async createAuthData() {
|
||||
const appFields = this.client.appData.fields.find(
|
||||
const appFields = this.client.connection.appData.fields.find(
|
||||
(field: IField) => field.key == 'oAuthRedirectUrl'
|
||||
);
|
||||
const callbackUrl = appFields.value;
|
||||
@@ -30,8 +30,9 @@ export default class Authentication implements IAuthentication {
|
||||
const responseData = Object.fromEntries(new URLSearchParams(response.data));
|
||||
|
||||
return {
|
||||
consumerKey: this.client.connectionData.consumerKey,
|
||||
consumerSecret: this.client.connectionData.consumerSecret,
|
||||
consumerKey: this.client.connection.formattedData.consumerKey as string,
|
||||
consumerSecret: this.client.connection.formattedData
|
||||
.consumerSecret as string,
|
||||
accessToken: responseData.oauth_token,
|
||||
accessSecret: responseData.oauth_token_secret,
|
||||
userId: responseData.user_id,
|
||||
|
Reference in New Issue
Block a user