auth-module icon indicating copy to clipboard operation
auth-module copied to clipboard

How to use Nuxt Auth with Pinia instead of Vuex ?

Open juvpengele opened this issue 2 years ago • 2 comments

I am working with a Nuxt 2 application and I would like to setup authentication using Nuxt Auth module. After have set a local strategy to handle authentication, I receive this warning in the console "[AUTH] The Vuex Store is not activated. This might cause issues in auth module behavior, like redirects not working properly"

I do not use Vuex as the state management library, How can I let know to auth to use pinia instead of Vuex ?

juvpengele avatar Jun 16 '22 07:06 juvpengele

我正在使用Nuxt 2应用程序,我想使用Nuxt身份验证模块设置身份验证。设置本地策略以处理身份验证后,我在控制台中收到此警告“[AUTH] Vuex 存储未激活。这可能会导致身份验证模块行为出现问题,例如重定向无法正常工作”

我不使用Vuex作为状态管理库,我怎样才能让我知道使用pinia而不是Vuex?

According to your usage, I tried the github-auth demo yesterday, it seems that the status is packaged by vuex.This caused a lot of problems, like https://github.com/nuxt-community/auth-module/issues/1766, which returned a post request error in the console, maybe it needs to be changed?

iusx avatar Jun 17 '22 13:06 iusx

@juvpengele Hi maybe it helps https://github.com/nuxt-community/auth-module/issues/1273#issuecomment-904060260

My latest used gist- nuxt-auth + pinia instead vuex

ttkoma avatar Jul 26 '22 15:07 ttkoma