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