Mutate the session state when using the useSession() hook for JWT #328

Closed
opened 2026-03-13 07:41:58 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @laakal on GitHub (Dec 3, 2024).

Add an update function to the return of useSession.

const { update } = useSession()
await update({... arbitrary data})

This will update the session anywhere, where you are referencing it with useSession(). The update() method will also return the updated session.

Originally created by @laakal on GitHub (Dec 3, 2024). Add an update function to the return of useSession. ```js const { update } = useSession() await update({... arbitrary data}) ``` This will update the session anywhere, where you are referencing it with useSession(). The update() method will also return the updated session.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#328