nuxt-community / auth-module

Zero-boilerplate authentication support for Nuxt 2
https://auth.nuxtjs.org
MIT License
1.92k stars 923 forks source link

Multiple Token Refresh #1673

Open yeezussniper opened 2 years ago

yeezussniper commented 2 years ago

Hello! We have a nuxt project on one domain domen.com and api on another domain api.domen.com. We use nuxt auth jwt. On the api-tymondesigns/jwt-auth side. Everything works fine, but on the same device, several refresh requests are made during authorization. After that, when working on the site, an error 401 due to an expired token (blacklist).

nuxt.config.js

auth: { redirect: { login: '/auth', logout: '/auth', }, cookie: { options: { sameSite: 'lax', }, }, strategies: { 'laravelJWT': { provider: 'laravel/jwt', scheme: 'refresh', url: '/auth', endpoints: { login: { url: '/login', method: 'post' }, logout: { url: '/logout', method: 'post' }, refresh: { url: '/refresh', method: 'post' }, //на время отключил user: { url: '/me', method: 'get' } }, token: { property: 'access_token', global: true, }, refreshToken: { property: 'access_token', data: 'access_token', tokenRequired: true } }, } }

Please help as I can't figure it out myself. "@nuxtjs/auth-next": "^5.0.0-1643791578.532b3d6", "@nuxtjs/axios": "^5.13.6",

sadeghi-aa commented 1 year ago

Having the same issue here. Could solve it using the solutions found on the web.