Added auth headers to api requests

This commit is contained in:
Paweł Malak
2021-11-12 12:38:01 +01:00
parent 0d36c5cf94
commit d94a6cea5a
12 changed files with 135 additions and 56 deletions

View File

@@ -0,0 +1,4 @@
export const applyAuth = () => {
const token = localStorage.getItem('token') || '';
return { Authorization: `Bearer ${token}` };
};

View File

@@ -10,3 +10,4 @@ export * from './storeUIConfig';
export * from './validators';
export * from './parseTime';
export * from './decodeToken';
export * from './applyAuth';