Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: signOut function is not completing and thus not creating logout events in log table #73

Closed
burggraf opened this issue Apr 9, 2021 · 0 comments

Comments

@burggraf
Copy link
Member

burggraf commented Apr 9, 2021

https://github.com/supabase/gotrue-js/blob/4daa22cf30a2fe25bd1df9d9df0061c17d81a691/src/GoTrueClient.ts#L314

The signOut function never calls this.api.signOut because it's first removing the current session with this._removeSession(), then later checks for this.currentSession before calling this.api.signOut, so this.api.signOut never gets called.

Essentially, no logout is ever taking place. The code is only removing the current session.

The result of this is that if you look in the log table you only see login events, even if you log in, log out, log in, log out, etc.

async signOut(): Promise<{ error: Error | null }> {
    this._removeSession()
    this._notifyAllSubscribers('SIGNED_OUT')
    if (this.currentSession) {
      const { error } = await this.api.signOut(this.currentSession.access_token)
      if (error) return { error }
    }
    return { error: null }
  }
@burggraf burggraf changed the title signOut function is not completing and thus not creating logout events in log table Bug: signOut function is not completing and thus not creating logout events in log table Apr 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants