Files
lrc-frontend/src/helpers/auth-header.ts

11 lines
286 B
TypeScript

export function authHeader() {
// return authorization header with jwt token
// @ts-ignore
let user = JSON.parse(localStorage.getItem('user'));
if (user && user.token) {
return { 'Authorization': 'Bearer ' + user.token };
} else {
return {};
}
}