[GH-ISSUE #753] Mutate the session state when using the useSession() hook for JWT #8411

Closed
opened 2026-04-13 03:28:47 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @laakal on GitHub (Dec 3, 2024).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/753

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). Original GitHub issue: https://github.com/better-auth/better-auth/issues/753 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.
GiteaMirror added the locked label 2026-04-13 03:28:47 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#8411