nuxt-modules / kinde

Kinde integration for Nuxt
62 stars 5 forks source link

useAuth in pinia store #78

Closed faststare08 closed 2 months ago

faststare08 commented 3 months ago

it cant detect/use the useAuth composable in pinia store.

DanielRivers commented 3 months ago

Hi @faststare08,

Are you able to give example of your store? The below code functions as expected

export const useCounterStore = defineStore('counter', {
    state: () => ({ count: 0, name: 'Eduardo' }),
    getters: {
      doubleCount: (state) => {
        const auth = useAuth()
        console.log(auth.loggedIn)
        return state.count * 2
      }
    },
    actions: {
      increment() {
        this.count++
      },
    },
  })
DanielRivers commented 2 months ago

Closed assumed last answer resolved issue, if still a problem please comment