Skip to content

Commit cdf40d3

Browse files
committed
Conditionally include Authorization header in apiFetch
1 parent e0d56e5 commit cdf40d3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/utils/api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export async function apiFetch<T>(url: string, options: FetchOptions): Promise<A
2727
const response = await fetch(url, {
2828
method: options.method,
2929
headers: {
30-
Authorization: `Bearer ${token}`,
30+
...(token ? { Authorization: `Bearer ${token}` } : {}),
3131
"Content-Type": "application/json",
3232
"Anytype-Version": currentApiVersion,
3333
...options.headers,

0 commit comments

Comments
 (0)