New Dec 28, 2024

Laravel Sanctum and Nuxt Auth Utils

Libraries, Frameworks, etc. All from Newest questions tagged vue.js - Stack Overflow View Laravel Sanctum and Nuxt Auth Utils on stackoverflow.com

I've started project with Laravel and Nuxt3. But I can't use nuxt-auth-utils with sanctum. It doesn't work.

I try login, laravel return token then it processes another request - https://ecommerce.loc:3000/api/_auth/session and return {} and it dosen't authenticate.

            const login = async () => {
                await $fetch('https://ecommerce.loc/api/login', {
                    method: 'POST',
                    body: {
                        email: form.email,
                        password: form.password,
                    },
                }).then(async (data) => {
                    fetch();

toast.add({ color: 'green', title: 'User logged in successfully', });

// router.push('/admin'); }).catch((err) => { console.log(err)

toast.add({ color: 'red', title: err.data?.message || err.message, }) }) }

I tried to use documentation. But i don't find any information about using nuxt-auth-utils with sanctum.

Scroll to top