File size: 268 Bytes
c6be9e8
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
export function authHeader() {
    // return authorization header with jwt token
    let user = JSON.parse(localStorage.getItem('user'));

    if (user && user.token) {
        return { 'Authorization': 'Bearer ' + user.token };
    } else {
        return {};
    }
}