manchenkoff/nuxt-auth-sanctum

use in pinia

Closed this issue · 2 comments

i can't use const client = useSanctumClient() in pinia

Error: TypeError: client is not a function

Hey @iranpourX, please re-create this issue with a Bug template and provide all necessary details in the description, including your code sample where you are trying to use this module, thanks!

initialize the client inyour pinia action. it does not behave like axios that you can register globally because its a composable in this case.
@manchenkoff correct me if im wrong...


actions: {
        async fetchStuff(id) {
            const client = useSanctumClient()