Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions admin/authentication-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,16 @@ import { parseHydraDocumentation } from "@api-platform/api-doc-parser";
import authProvider from "utils/authProvider";
import { ENTRYPOINT } from "config/entrypoint";

const getHeaders = () => localStorage.getItem("token") ? {
Authorization: `Bearer ${localStorage.getItem("token")}`,
} : {};
const getHeaders = (defaultHeaders = {}) => {
const authHeaders = localStorage.getItem("token")
? { Authorization: `Bearer ${localStorage.getItem("token")}` }
: {};

return {
...defaultHeaders,
...authHeaders,
};
};
const fetchHydra = (url, options = {}) =>
baseFetchHydra(url, {
...options,
Expand Down
Loading