@lfai/egeria-js-commons
Version:
Common module for storing static data such as key value objects, SVGs, icon mappings, API urls.
24 lines (23 loc) • 531 B
JavaScript
import { token } from '../token';
export function authHeader() {
const _token = token.getValue();
if (_token) {
return { "Authorization": `Bearer ${_token}` };
}
else {
return {};
}
}
export function authHeaderWithContentType() {
const _token = token.getValue();
if (_token) {
return {
"Content-type": "application/json",
"accept": "application/json",
"Authorization": `Bearer ${_token}`
};
}
else {
return {};
}
}