refactor(slack): move scopes out of function definition

This commit is contained in:
Ali BARIN
2022-11-03 18:01:35 +01:00
parent ff76e37efc
commit 2ffce75056

View File

@@ -1,8 +1,7 @@
import { IField, IGlobalVariable } from '@automatisch/types'; import { IField, IGlobalVariable } from '@automatisch/types';
import qs from 'qs'; import qs from 'qs';
export default async function createAuthData($: IGlobalVariable) { const scopes = [
const scopes = [
'channels:manage', 'channels:manage',
'channels:read', 'channels:read',
'channels:join', 'channels:join',
@@ -18,8 +17,8 @@ export default async function createAuthData($: IGlobalVariable) {
'workflow.steps:execute', 'workflow.steps:execute',
'users:read.email', 'users:read.email',
'commands', 'commands',
]; ];
const userScopes = [ const userScopes = [
'channels:history', 'channels:history',
'channels:read', 'channels:read',
'channels:write', 'channels:write',
@@ -41,7 +40,9 @@ export default async function createAuthData($: IGlobalVariable) {
'users.profile:write', 'users.profile:write',
'users:read', 'users:read',
'users:read.email', 'users:read.email',
]; ];
export default async function createAuthData($: IGlobalVariable) {
const oauthRedirectUrlField = $.app.auth.fields.find( const oauthRedirectUrlField = $.app.auth.fields.find(
(field: IField) => field.key == 'oAuthRedirectUrl' (field: IField) => field.key == 'oAuthRedirectUrl'
); );