mirror of
https://github.com/hex248/sprint.git
synced 2026-02-08 02:33:01 +00:00
getAuthHeaders now returns a HeadersInit
This commit is contained in:
@@ -9,10 +9,10 @@ export function issueID(blob: string, num: number) {
|
|||||||
return `${blob}-${num.toString().padStart(3, "0")}`;
|
return `${blob}-${num.toString().padStart(3, "0")}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getAuthHeaders(): Headers {
|
export function getAuthHeaders(): HeadersInit {
|
||||||
const token = localStorage.getItem("token");
|
const token = localStorage.getItem("token");
|
||||||
if (!token) return new Headers();
|
if (!token) return {};
|
||||||
return new Headers({ Authorization: `Bearer ${token}` });
|
return { Authorization: `Bearer ${token}` };
|
||||||
}
|
}
|
||||||
|
|
||||||
export function capitalise(str: string) {
|
export function capitalise(str: string) {
|
||||||
|
|||||||
Reference in New Issue
Block a user