Closed jrsamuel closed 4 years ago
I'm experiencing this same behavior.
Hey you two
Try doing it with a watch() function like mentioned here.
Let me know if that works for you.
Confirming this worked for me. Thanks you!
Worked for me as well.
I looked through previous issues before I posted but I guessed I missed this one. Sorry.
Still might be nice to have some callback to reference instead of having to use a watcher for this. But this will work.
Thanks for the help.
I am using the Auth.initialize option in my nuxt.config.js file as follows
And in the store, I do a simple mutation as follows
I await the login and then redirect as follows
The '/bank' page has a middleware navigation guard that checks to see if the user has been set in the store. Since the mutation is asynchronous, the redirect fails because the user isn't set. The console log returns null.
Since this module is calling the mutation 'behind the scenes', I don't know how to detect when the mutation is complete so I can wait to fire the redirect.
Hope that is clear... any ideas on how to do this?
Thanks for any help anyone can provide.