Closed moshetanzer closed 3 months ago
Sounds like a Nuxt question? I don't use Nuxt so I don't think I help much either
@pilcrowOnPaper, nope - it is a lucia question. Why is user.value still true after logging out before completion of redirect to login page...
Because there's nothing updating the value of user.value
? Just set the value to null
after making a fetch request if you need it before the redirect
you rock - just to understand, after redirect it auto sets to null?
On Fri, Mar 15, 2024 at 1:20 AM pilcrow @.***> wrote:
Because there's nothing updating the value of user.value? Just set the value to null after making a fetch request if you need it before the redirect
— Reply to this email directly, view it on GitHub https://github.com/lucia-auth/lucia/issues/1489#issuecomment-1998633493, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATTEVLK6HMVCVXKH7OYH3Q3YYIWC7AVCNFSM6AAAAABEW7M7WWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOJYGYZTGNBZGM . You are receiving this because you authored the thread.Message ID: @.***>
When you redirect, the middleware for the destination page runs which fetches the latest user data
Package
lucia
Describe the bug
For the login page of my Nuxt 3 app if user is logged in I want to redirect the user to dashboard page automatically. You can't use authenticatedUser() on the login page since it is not a protected page, and when using user to do a simple test like this both in middleware or on login page itself when signing out - it stays on dashboard page until complete refresh?
Thanks for the lib and goold luck with uni