mirror of
https://github.com/Sea-Haven-Industries/shoc-frontend-new.git
synced 2026-09-30 04:33:11 +00:00
Add auth token to ApiService requests
- services/api.js was not sending Authorization header on any request - Import getAccessToken and include it in all ApiService.request() calls
This commit is contained in:
parent
2dcb140d10
commit
9ae7c9b262
1 changed files with 3 additions and 0 deletions
|
|
@ -1,4 +1,6 @@
|
|||
// API Base Configuration
|
||||
import { getAccessToken } from "../tokenUtility";
|
||||
|
||||
const API_BASE_URL = process.env.REACT_APP_API_URL || '';
|
||||
const API_PREFIX = '/api';
|
||||
|
||||
|
|
@ -14,6 +16,7 @@ class ApiService {
|
|||
const config = {
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Authorization': getAccessToken(),
|
||||
...options.headers,
|
||||
},
|
||||
...options,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue