Questions tagged [nuxt-auth]

187 questions
1
vote
0 answers

Redirect route after login using nuxt auth module

I use nuxt auth module when I route to a guard page when I don't log in the login page is open but if I don't log in and go to another page not guarded and login successfully, automatically redirect me to the last guarded page I was open before if…
1
vote
1 answer

Try/catch a promise or just catch?

this.$auth.loginWith returns a promise, but I am unsure if I should wrap it in a try/catch or just use a catch on the promise. Which is the correct way? Try/Catch: async login() { try { const response = await…
panthro
  • 22,779
  • 66
  • 183
  • 324
1
vote
1 answer

Redirected to login after refreshing page in nuxtjs and laravel sanctum

i have a problem with Nuxt SSR mode in production auth with Laravel sanctum login success but when refresh any page, redirecting to login page and logout !!!
1
vote
1 answer

Django-NuxtJs: can't get cookie from request

I am using django and nuxt js to create a webapplication but I am having a problem with getting the user's data from the server after authentication. I tried using cookies but it didn't work so far. the server can't get the cookie from the request…
1
vote
2 answers

How is nuxt/auth really secure?

Let's imagine a client opens your nuxt.js website on the index page. From there, they authenticate (you used @nuxtjs/auth-next for that purpose). Then they move to a secure page that only authenticated users can see. This secure page is a .vue file…
Kay
  • 75
  • 8
1
vote
1 answer

Nuxt fetchUser Auth function isn't reactive and requires a hard refresh

Using Nuxt 2.15.3, with a Rails backend. I'm trying to create a Google OAuth workflow in my app, and I'm having some trouble with the steps after getting the access code. Once the user authenticates with Google and gets redirected back with the…
Sensanaty
  • 894
  • 1
  • 12
  • 35
1
vote
0 answers

Nuxt js authentication doesn't work with @nuxt/proxy

I am building a project with Nuxt and trying to implement an authentication using @nuxtjs/axios and @nuxtjs/auth. When i'm trying to login, the url doesn't path to what in the proxy does. what do i expect is it will going to ex.http://blabla.com,…
Nta
  • 79
  • 6
1
vote
1 answer

Nuxt Auth extend / modify Google Social

I've set up social authentication using dj-rest-auth / django allauth. The endpoint expects this info as JSON: Unfortunately it seems to me like Nuxt Auth assumes the backend should extract the information from the URL, although it sends it as a…
Thorvald
  • 546
  • 6
  • 18
1
vote
0 answers

Nuxt auth session cookie after browser is closed

Noob in authentication and having issue with nuxt auth cookie strategy. My backend is golang, and I set cookie after successful login http.SetCookie(w, &http.Cookie{ Name: "session_token", Value: sessionToken, …
1
vote
0 answers

Issue with Router within Nuxt setup

I have seen multiple people posting in regards to similar (if not the same issue) but none of the solutions work for me. I have a standard auth gateway using a local strategy (email, password) and I want to redirect to root (or their dedicated page)…
Rue
  • 49
  • 1
  • 10
1
vote
1 answer

JWT refresh token practice

I'm trying to implement a refresh token concept on my website. if I understand correctly the refresh token should be a unique identifier for a user to get a new token (the token is valid for 15min only). I'm using customId package to generate a…
eMan_8888
  • 95
  • 7
1
vote
1 answer

Nuxt-Auth (Google Provider): JWT received from strapi backend but No redirection to home page

I'm building a frontend app based on NuxtJS with Strapi as the backend. I've already configured the google provider on Strapi. However, once it's time to connect it with the frontend I run into a problem. Basically, after logging in, it redirects me…
1
vote
2 answers

Can't fetch user right after login, but refresh works @nuxt-auth

Login is successful, but can't fetch user infos until i refresh the page. // Login Component try { await this.$auth.loginWith("mg_login", { data: this.user, }); } catch (e) { this.$toast.error("Error!", { duration: 1500 }); …
Lynx
  • 23
  • 1
  • 7
1
vote
1 answer

Nuxt & Strapi - Logging in with OAuth using Github

I am setting up a community website with a Strapi CMS backend and a NuxtJS frontend using the composition API. Besides the normal registration and login using email and username (which works!), I want users to be able to login using GitHub. I am…
DrKlonk
  • 31
  • 4
1
vote
1 answer

NuxtJS route middleware for specific routes

I want to protect certain routes to be only available when a user is logged in. The way I want to do this is make a API call to verify the current token. The token can be either in Local storage or the store (VueX). I created a middleware called…
user14685910