mirror of
https://github.com/TheRealOwenRees/chess-scribe-website.git
synced 2026-07-23 01:46:57 +00:00
change response on access token delete function
This commit is contained in:
@@ -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
|
||||||
@@ -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 () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user