mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-23 17:08:34 +00:00
Merge pull request #8094 from ToolJet/main
Merge main to develop (v2.22.3)
This commit is contained in:
commit
7537ad895a
7 changed files with 28 additions and 15 deletions
2
.version
2
.version
|
|
@ -1 +1 @@
|
|||
2.22.2
|
||||
2.22.3
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
2.22.2
|
||||
2.22.3
|
||||
|
|
|
|||
|
|
@ -124,9 +124,12 @@ function validateAndMaybeSetOAuthHeaders(sourceOptions, context, headers): Query
|
|||
|
||||
export function getAuthUrl(sourceOptions: any): string {
|
||||
const customQueryParams = sanitizeCustomParams(sourceOptions['custom_query_params']);
|
||||
const tooljetHost = process.env.TOOLJET_HOST;
|
||||
const host = process.env.TOOLJET_HOST;
|
||||
const subpath = process.env.SUB_PATH;
|
||||
const fullUrl = `${host}${subpath ? subpath : '/'}`;
|
||||
|
||||
const authUrl = new URL(
|
||||
`${sourceOptions['auth_url']}?response_type=code&client_id=${sourceOptions['client_id']}&redirect_uri=${tooljetHost}/oauth2/authorize&scope=${sourceOptions['scopes']}`
|
||||
`${sourceOptions['auth_url']}?response_type=code&client_id=${sourceOptions['client_id']}&redirect_uri=${fullUrl}oauth2/authorize&scope=${sourceOptions['scopes']}`
|
||||
);
|
||||
Object.entries(customQueryParams).map(([key, value]) => authUrl.searchParams.append(key, value));
|
||||
return authUrl.toString();
|
||||
|
|
|
|||
|
|
@ -5,7 +5,9 @@ import { SourceOptions, QueryOptions } from './types';
|
|||
|
||||
export default class GooglesheetsQueryService implements QueryService {
|
||||
authUrl(): string {
|
||||
const tooljetHost = process.env.TOOLJET_HOST;
|
||||
const host = process.env.TOOLJET_HOST;
|
||||
const subpath = process.env.SUB_PATH;
|
||||
const fullUrl = `${host}${subpath ? subpath : '/'}`;
|
||||
const clientId = process.env.GOOGLE_CLIENT_ID;
|
||||
const clientSecret = process.env.GOOGLE_CLIENT_SECRET;
|
||||
|
||||
|
|
@ -16,7 +18,7 @@ export default class GooglesheetsQueryService implements QueryService {
|
|||
return (
|
||||
'https://accounts.google.com/o/oauth2/v2/auth' +
|
||||
`?response_type=code&client_id=${clientId}` +
|
||||
`&redirect_uri=${tooljetHost}/oauth2/authorize`
|
||||
`&redirect_uri=${fullUrl}oauth2/authorize`
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -24,8 +26,10 @@ export default class GooglesheetsQueryService implements QueryService {
|
|||
const accessTokenUrl = 'https://oauth2.googleapis.com/token';
|
||||
const clientId = process.env.GOOGLE_CLIENT_ID;
|
||||
const clientSecret = process.env.GOOGLE_CLIENT_SECRET;
|
||||
const tooljetHost = process.env.TOOLJET_HOST;
|
||||
const redirectUri = `${tooljetHost}/oauth2/authorize`;
|
||||
const host = process.env.TOOLJET_HOST;
|
||||
const subpath = process.env.SUB_PATH;
|
||||
const fullUrl = `${host}${subpath ? subpath : '/'}`;
|
||||
const redirectUri = `${fullUrl}oauth2/authorize`;
|
||||
const grantType = 'authorization_code';
|
||||
const customParams = { prompt: 'consent', access_type: 'offline' };
|
||||
|
||||
|
|
|
|||
|
|
@ -5,16 +5,20 @@ import { SourceOptions, QueryOptions } from './types';
|
|||
export default class SlackQueryService implements QueryService {
|
||||
authUrl(): string {
|
||||
const clientId = process.env.SLACK_CLIENT_ID;
|
||||
const tooljetHost = process.env.TOOLJET_HOST;
|
||||
return `https://slack.com/oauth/v2/authorize?response_type=code&client_id=${clientId}&redirect_uri=${tooljetHost}/oauth2/authorize`;
|
||||
const host = process.env.TOOLJET_HOST;
|
||||
const subpath = process.env.SUB_PATH;
|
||||
const fullUrl = `${host}${subpath ? subpath : '/'}`;
|
||||
return `https://slack.com/oauth/v2/authorize?response_type=code&client_id=${clientId}&redirect_uri=${fullUrl}oauth2/authorize`;
|
||||
}
|
||||
|
||||
async accessDetailsFrom(authCode: string): Promise<object> {
|
||||
const accessTokenUrl = 'https://slack.com/api/oauth.v2.access';
|
||||
const clientId = process.env.SLACK_CLIENT_ID;
|
||||
const clientSecret = process.env.SLACK_CLIENT_SECRET;
|
||||
const tooljetHost = process.env.TOOLJET_HOST;
|
||||
const redirectUri = `${tooljetHost}/oauth2/authorize`;
|
||||
const host = process.env.TOOLJET_HOST;
|
||||
const subpath = process.env.SUB_PATH;
|
||||
const fullUrl = `${host}${subpath ? subpath : '/'}`;
|
||||
const redirectUri = `${fullUrl}oauth2/authorize`;
|
||||
|
||||
const body = `code=${authCode}&client_id=${clientId}&client_secret=${clientSecret}&redirect_uri=${redirectUri}`;
|
||||
|
||||
|
|
|
|||
|
|
@ -29,8 +29,10 @@ export default class Zendesk implements QueryService {
|
|||
const { clientId, clientSecret, subdomain, scope } = this.sanitizeOptions(options);
|
||||
|
||||
const accessTokenUrl = `https://${subdomain}.zendesk.com/oauth/tokens`;
|
||||
const tooljetHost = process.env.TOOLJET_HOST;
|
||||
const redirectUri = `${tooljetHost}/oauth2/authorize`;
|
||||
const host = process.env.TOOLJET_HOST;
|
||||
const subpath = process.env.SUB_PATH;
|
||||
const fullUrl = `${host}${subpath ? subpath : '/'}`;
|
||||
const redirectUri = `${fullUrl}oauth2/authorize`;
|
||||
const grantType = 'authorization_code';
|
||||
|
||||
const data = {
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
2.22.2
|
||||
2.22.3
|
||||
|
|
|
|||
Loading…
Reference in a new issue