Skip to content

Commit

Permalink
fix(refresh scheme): return login response
Browse files Browse the repository at this point in the history
  • Loading branch information
JoaoPedroAS51 committed Mar 3, 2020
1 parent b4137eb commit 2980892
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/schemes/refresh.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,14 +264,20 @@ export default class RefreshScheme extends LocalScheme {
await this.$auth.reset()

// Make login request
const loginResult = await this.$auth.request(endpoint, this.options.endpoints.login)
const { response, result } = await this.$auth.request(
endpoint,
this.options.endpoints.login,
true
)

this._updateTokens(loginResult)
this._updateTokens(result)
this._scheduleTokenRefresh()

if (this.options.autoFetchUser) {
await this.fetchUser()
}

return response
}

async fetchUser (endpoint) {
Expand Down

0 comments on commit 2980892

Please sign in to comment.