webapp: Change authHeader to return Headers object instead of Record<string, string>
This commit is contained in:
parent
a646eae51a
commit
7798854b2b
@ -1,11 +1,11 @@
|
|||||||
export function authHeader(): HeadersInit {
|
export function authHeader(): Headers {
|
||||||
// return authorization header with basic auth credentials
|
// return authorization header with basic auth credentials
|
||||||
let user = JSON.parse(localStorage.getItem('user') || "");
|
let user = JSON.parse(localStorage.getItem('user') || "");
|
||||||
|
|
||||||
if (user && user.authdata) {
|
if (user && user.authdata) {
|
||||||
return { 'Authorization': 'Basic ' + user.authdata };
|
return new Headers({ 'Authorization': 'Basic ' + user.authdata })
|
||||||
} else {
|
} else {
|
||||||
return {};
|
return new Headers();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user