N
Nuxt3mo ago
Biscuit

Nuxt nuxt/auth basic auth

I did this like I were coding for a react app, I feel like I am doing extra work. I tried using nuxt/auth but it seems to only work with providers and not simple servers requests. Every tutorial online is using a provider for authentication. I have a server that works with basic auth, and I am just not able to make my nuxt app consume the api. note: As for now, I am not using this nuxt/auth. I am using refresh/access tokens, whenever the page is refreshed the http-only cookie (containing the refresh token) should be sent in the request made to /refresh-token, but the jid token is not being added to the request.
const response = await fetch(`${config.public.appServer}/refresh-token`, {
headers: {
"Content-Type": "application/json",
},
credentials: "include",
});
const response = await fetch(`${config.public.appServer}/refresh-token`, {
headers: {
"Content-Type": "application/json",
},
credentials: "include",
});
I am using cookies to keep the current accessToken, I'd like to have it in memory instead but it seems that using cookies to store it is the way to go. I am quite lost, just take a look at the login page, middlewares and authStore. If you people have a project that's making a request to a custom auth-server let me know https://github.com/doubleyooz/nuxt-gighub
0 Replies
No replies yetBe the first to reply to this messageJoin