webapp: Change authHeader to return Headers object instead of Record<string, string>

This commit is contained in:
Thomas Basler 2022-11-04 00:01:34 +01:00
parent a646eae51a
commit 7798854b2b

View File

@ -1,11 +1,11 @@
export function authHeader(): HeadersInit {
export function authHeader(): Headers {
// return authorization header with basic auth credentials
let user = JSON.parse(localStorage.getItem('user') || "");
if (user && user.authdata) {
return { 'Authorization': 'Basic ' + user.authdata };
return new Headers({ 'Authorization': 'Basic ' + user.authdata })
} else {
return {};
return new Headers();
}
}