feat(strava): add authentication support
This commit is contained in:
13
packages/backend/src/apps/strava/common/add-auth-header.ts
Normal file
13
packages/backend/src/apps/strava/common/add-auth-header.ts
Normal 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;
|
Reference in New Issue
Block a user