change response on access token delete function

This commit is contained in:
2026-06-10 12:11:57 +02:00
parent ed820b7fd1
commit 80c2cce4de
2 changed files with 9 additions and 3 deletions
+2 -2
View File
@@ -10,5 +10,5 @@
add throw errors or return errors in server code add throw errors or return errors in server code
try/catch where needed in client code try/catch where needed in client code
on logout reset selectedStudyid
make login lichess button as wide as logout - full width? generate state and check it against the state returned from lichess https://lichess.org/api#tag/oauth/GET/oauth
+7 -1
View File
@@ -117,8 +117,14 @@ const deleteAccessToken = createServerFn().handler(async () => {
}, },
}); });
return await response.json(); if (!response.ok) {
throw new Error(`Failed to delete access token: ${response.statusText}`);
}
return { success: true };
} }
return { success: false, message: "No token found to delete." };
}); });
export const logout = createServerFn().handler(async () => { export const logout = createServerFn().handler(async () => {