You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
export default {
request: function (req, token) {
// If refresh, add refresh_token to request data
if (req.url === this.options.refreshData.url) {
req.data = { refresh_token: this.token(this.options.refreshTokenKey) }
}
this.drivers.http.setHeaders.call(this, req, {
Authorization: 'Bearer ' + token,
})
},
response: function (res) {
const resData = res.data || {}
// Store refresh_token if present
this.token(
this.options.refreshTokenKey,
resData[this.options.refreshTokenKey]
)
// Return access_token (auto stored)
return resData[this.options.tokenDefaultKey]
},
}
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!
The text was updated successfully, but these errors were encountered:
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!
The text was updated successfully, but these errors were encountered: