Log out with pageContext.user and once
#2583
-
|
Hi! I'm following the Vike auth guide to implement custom authentication. I’ve successfully handled login using a server-side I call an API endpoint that invalidates the session (stored in cookies). After that, I want the UI to reflect that the user is logged out. Is there a way to update |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
|
I see (and the docs should be updated to mention this). Can you confirm the following? pageContext.globalContext.user = null
console.log(pageContext.user === null) // Logs trueWhy doesn't it solve the issue? |
Beta Was this translation helpful? Give feedback.
Ended up deprecating the
oncesetting. Simply don't use it and it should just work. Make sure to update to0.4.237(it contains a bug fix you'll need).See also:
Let me know if you still have any issues. (I've seen that HRM doesn't always work with your reproduction, I'll have a look at it.)