gotrue-js v 2.62.0 vs 2.61.0 logged in state issues?
I upgraded and noticed I got logged out on every reload. (Or redirected to the login screen).
This was because on my userStore I have a
I update this variable App.vue's setup script where I watch this variable with immediate = true. So this script runs every my app starts.
My router seems to be running right before that. The router also checks this store and redirects if needed to login or dashboard if already logged in.
On supabase's gotrue-js v2.61.0 this works as expected. I've put a log entry on the App.vue and Router.ts which looks like this on a refresh:
Then I upgrade to gotrue-js v 2.62.0:
The logs changes to:
Anyone know why this is happening on a minor change? I see the commit talks about using navigatorLock instead:
https://github.com/supabase/gotrue-js/commit/b717b1cd9466ddc067aa0a5fad0d9e046e3782d4
I might have done the whole login check totally wrong? Maybe App.vue is not the right place?
This was because on my userStore I have a
isLoggedIn variable. This was set to false.I update this variable App.vue's setup script where I watch this variable with immediate = true. So this script runs every my app starts.
My router seems to be running right before that. The router also checks this store and redirects if needed to login or dashboard if already logged in.
On supabase's gotrue-js v2.61.0 this works as expected. I've put a log entry on the App.vue and Router.ts which looks like this on a refresh:
Then I upgrade to gotrue-js v 2.62.0:
The logs changes to:
Anyone know why this is happening on a minor change? I see the commit talks about using navigatorLock instead:
https://github.com/supabase/gotrue-js/commit/b717b1cd9466ddc067aa0a5fad0d9e046e3782d4
I might have done the whole login check totally wrong? Maybe App.vue is not the right place?
GitHub
After having spent months of real-world testing on supabase.com, the
LocksManager
API](https://developer.mozilla.org/en-US/docs...
navigatorLock is enabled on browsers that support the [NavigatorLocksManager
API](https://developer.mozilla.org/en-US/docs...