-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
User is not logged in #37
Comments
Hi, how do you call the login method? There should be no need to fetch user manually. |
Hi, im using a normal login function, like this: Then I see the token afterwards as a cookie, but it seems like 'auth' is not working because when im trying to get the user it works fine, apparently the using is just not seen as logged in for 'Auth' in nuxt. |
Hi, Same problem all cookies are set. But |
Did you find solution to this? |
Hi, I want to be able to know whether the user is logged in, using the useAuth() function, but it seemed like the user is never logged in, when using the $sanctumAuth.login.
Im able to call the protected routes on the api, so the csrf token is working as expected, but on locale host and in production, but the user is never set, using useAuth().
What am I doing wrong?
This is the nuxt.config.js file
nuxtSanctumAuth: {
token: false,
baseUrl: process.env.NUXT_PUBLIC_API_URL || "https://endpoint",
endpoints: {
csrf: "/sanctum/csrf-cookie",
login: "/login",
logout: "/logout",
user: "/api/v1/user",
},
csrf: {
headerKey: 'X-XSRF-TOKEN',
cookieKey: 'XSRF-TOKEN',
tokenCookieKey: 'nuxt-sanctum-auth-token',
},
redirects: {
home: "/",
login: "/login",
logout: "/",
},
},
The text was updated successfully, but these errors were encountered: