add login, register, logout and devices list (including remove device)

This commit is contained in:
Jorrin
2024-04-21 16:42:07 +02:00
parent ef97313fb9
commit a89ef8a901
14 changed files with 546 additions and 201 deletions

View File

@@ -38,7 +38,10 @@ export async function f<T>(url: string, ops?: FetcherOptions): Promise<T> {
const fullUrl = makeFullUrl(url, ops);
const response = await fetch(fullUrl, {
method: ops?.method ?? "GET",
headers: ops?.headers,
headers: {
"Content-Type": "application/json",
...ops?.headers,
},
body: ops?.body ? JSON.stringify(ops.body) : undefined,
});