mirror of
https://github.com/20kaushik02/spotify-manager.git
synced 2026-01-25 14:14:06 +00:00
moved authHeader to middleware
This commit is contained in:
13
axios.js
13
axios.js
@@ -19,20 +19,7 @@ const axiosInstance = axios.default.create({
|
||||
},
|
||||
});
|
||||
|
||||
const getAuthHeaders = (req) => {
|
||||
let authHeaders;
|
||||
|
||||
if (req.session.access_token) {
|
||||
authHeaders = {
|
||||
'Authorization': req.session.access_token ? `Bearer ${req.session.access_token}` : '',
|
||||
}
|
||||
}
|
||||
|
||||
return authHeaders;
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
authInstance,
|
||||
axiosInstance,
|
||||
getAuthHeaders,
|
||||
};
|
||||
Reference in New Issue
Block a user