feat(miro): add miro integration

This commit is contained in:
Rıdvan Akca
2023-09-25 11:54:47 +03:00
committed by Faruk AYDIN
parent cc1f9873cb
commit fa8ac0a8ba
10 changed files with 177 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
import { TBeforeRequest } from '@automatisch/types';
const addAuthHeader: TBeforeRequest = ($, requestConfig) => {
if ($.auth.data?.accessToken) {
requestConfig.headers.Authorization = `${$.auth.data.tokenType} ${$.auth.data.accessToken}`;
}
return requestConfig;
};
export default addAuthHeader;

View File

@@ -0,0 +1,10 @@
import { IGlobalVariable } from '@automatisch/types';
const getCurrentUser = async ($: IGlobalVariable) => {
const { data } = await $.http.get(
`https://api.miro.com/v1/oauth-token?access_token=${$.auth.data.accessToken}`
);
return data.user;
};
export default getCurrentUser;