Skip to content

Commit

Permalink
feat: call SIGNED_OUT event if token refresh fails
Browse files Browse the repository at this point in the history
  • Loading branch information
hf committed Dec 1, 2023
1 parent e46a324 commit abcb6a1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/GoTrueClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1753,6 +1753,11 @@ export default class GoTrueClient {
if (isAuthError(error)) {
const result = { session: null, error }

if (!isAuthRetryableFetchError(error)) {
await this._removeSession()
await this._notifySubscribers('SIGNED_OUT', null)
}

this.refreshingDeferred?.resolve(result)

return result
Expand Down

0 comments on commit abcb6a1

Please sign in to comment.