diff --git a/packages/backend/src/apps/slack/common/get-current-user.ts b/packages/backend/src/apps/slack/common/get-current-user.ts new file mode 100644 index 00000000..e0500f8f --- /dev/null +++ b/packages/backend/src/apps/slack/common/get-current-user.ts @@ -0,0 +1,13 @@ +import { IGlobalVariable, IJSONObject } from '@automatisch/types'; + +const getCurrentUser = async ($: IGlobalVariable): Promise => { + const params = { + user: $.auth.data.userId as string, + } + const response = await $.http.get('/users.info', { params }); + const currentUser = response.data.user; + + return currentUser; +}; + +export default getCurrentUser;