'Nuxt auth refresh token from ASP.NET Core Indetity
I want to use nuxt auth with local refresh strategy. I have backend on ASP.NET Core. I’m stuck with refreshing token, API method for refresh not called. This is my configurtion (10 second age is for testing):
auth: {
redirect: {
login: '/login',
logout: '/login',
callback: '/login',
home: '/administration',
},
strategies: {
local: {
scheme: 'refresh',
token: {
property: 'token',
maxAge: 10, // seconds
global: true,
},
refreshToken: {
property: 'refresh_token',
data: 'refresh_token',
maxAge: 604800, // seconds, 1 week
},
user: { property: 'Username', autoFetch: true },
endpoints: {
login: { url: '/authenticate/login', method: 'post' },
logout: { url: '/authenticate/logout', method: 'post' },
user: {
url: '/authenticate/current',
method: 'get',
propertyName: false,
},
refresh: { url: '/authenticate/refresh-token/', method: 'post' },
},
},
},
},
When I call authenticate/current API method and token is expired (API return Token-Expired: true in header) vue redirect me to login page as I said in configuration. But, I want to automatically refresh token. What I'm doing wrong?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
