Skip to content

Commit

Permalink
fix(refresh scheme): handle errors
Browse files Browse the repository at this point in the history
  • Loading branch information
JoaoPedroAS51 committed Mar 3, 2020
1 parent 9cb65be commit b2937ab
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/schemes/refresh.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,9 @@ export default class RefreshScheme extends LocalScheme {
this.options.endpoints.refresh
).then(response => {
this._updateTokens(response)
}).catch(() => {
// TODO: Unhandled error
}).catch(error => {
this._logoutLocally()
this.$auth.callOnError(error, { method: 'refreshToken' })
})
}

Expand Down Expand Up @@ -290,9 +290,9 @@ export default class RefreshScheme extends LocalScheme {
this.name,
endpoint,
this.options.endpoints.user
).catch(() => {
// TODO: Unhandled error
).catch(error => {
requestFailed = true
this.$auth.callOnError(error, { method: 'fetchUser' })
})

// If the request has not failed, set user data
Expand Down

0 comments on commit b2937ab

Please sign in to comment.