feat(strava): add authentication support

This commit is contained in:
Ali BARIN
2022-11-06 17:20:12 +01:00
parent 8a0b5c24a5
commit 37c6b57a48
5 changed files with 198 additions and 0 deletions

View File

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