Skip to content

Commit

Permalink
feat(core): add scheduleTokenRefresh method
Browse files Browse the repository at this point in the history
  • Loading branch information
JoaoPedroAS51 authored and pi0 committed Mar 15, 2020
1 parent 32d41b0 commit 5b133c5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/core/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,17 @@ export default class Auth {
})
}

scheduleTokenRefresh () {
if (!this.strategy.refreshController) {
return Promise.resolve()
}

return Promise.resolve(this.strategy.refreshController.scheduleTokenRefresh()).catch(error => {
this.callOnError(error, { method: 'scheduleTokenRefresh' })
return Promise.reject(error)
})
}

// ---------------------------------------------------------------
// User helpers
// ---------------------------------------------------------------
Expand Down

0 comments on commit 5b133c5

Please sign in to comment.