Fix session being double requested
If the returned value of the fetched endpoint is blank that gets converted to undefined, which confuses the request sharing between the client and server causing the session to be requested on both sides. Transform value to null if it's blank so that the session fetch is de-duplicated.
This commit is contained in:
parent
b2a5b67096
commit
d4cbbcbc2d
1 changed files with 6 additions and 1 deletions
|
@ -1 +1,6 @@
|
|||
export const useAccountSession = () => useFetch("/api/auth/session");
|
||||
export const useAccountSession = () => useFetch(
|
||||
"/api/auth/session",
|
||||
{
|
||||
transform: (input) => input === undefined ? null : input,
|
||||
}
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue