Open darkons opened 2 years ago
In this case you would need to disable refresh and do it manually.
So in your options setup set the enabled
flag in refreshData
to false.
refreshData: {
url: '/v1/auth/refresh',
method: 'POST',
enabled: false,
interval: 60,
},
Then on login just put your own timer
setInterval(function () {
this.$auth.refresh();
}, 3000);
Where 3000 is whatever value you want of course.
First of all, thank you for this awesome auth package!
I did the following implementation for a based Laravel Passport API:
plugins/auth.js
login response
plugins/auth/drivers/passport.js
The question is, how can I set refreshData interval value depending on login response expires_in value? With this approach auth package will refresh token automatically based on token "true" expiration time.
Thank you in advance!