snouzy
BABetter Auth
ā¢Created by FrancyMak on 4/20/2025 in #help
useSession weird behaviour
Is it possible for you to provide a minimal reproduction example via github ? I'll be happy to help
16 replies
BABetter Auth
ā¢Created by FrancyMak on 4/20/2025 in #help
useSession weird behaviour
Does it work if you call
useCurrentUser
right in useNotificationsQuery
?16 replies
BABetter Auth
ā¢Created by FrancyMak on 4/20/2025 in #help
useSession weird behaviour
Oh okay, so in the first place you cannot do
session.data!.user.id
because in the first render, session.data
will not be defined, since it's client side it will have a little throttle (bcs of the cookie storage).
So the error say that he's waiting for the user is right.
Here's what i did :
16 replies
BABetter Auth
ā¢Created by FrancyMak on 4/20/2025 in #help
useSession weird behaviour
Hey, you are trying to access the
useSession
in a server context, which is a hook reserved to client side.
What you should do, in a server context, is something like this :
If you really want to use useSession()
, you should add "use client"
in the top of your file16 replies
BABetter Auth
ā¢Created by snouzy on 4/18/2025 in #help
Is it a possible to use a relation table as type for fields in additionalFields ? (beginner š
)
Oups, that was for testing purposes. I just missed the fact that i needed
customSessionClient
instead of inferAdditionalFields
Now everything is fully typed, even the relation with pages
What's your opinion about this ?
ā
Is it okay to include pages directly in the session
š¤ Or is it better to keep the session lightweight and fetch /me on the client side4 replies