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

Fix/signout not completing #74

Closed
wants to merge 4 commits into from

Conversation

burggraf
Copy link
Member

@burggraf burggraf commented Apr 10, 2021

What kind of change does this PR introduce?

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

What is the current behavior?

signOut does not complete and no log record is written to the log table

What is the new behavior?

A log record is successfully written.

return { error };
} else {
this._removeSession();
this._notifyAllSubscribers('SIGNED_OUT')''
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There seems to be a extra '' at the end here

}
return { error: null }
return { error: null };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove ; to align formatting with the rest of the file.

} else {
this._removeSession();
this._notifyAllSubscribers('SIGNED_OUT')''
return { error: null };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove ; to align formatting with the rest of the file.

@@ -312,13 +312,20 @@ export default class GoTrueClient {
* For server-side management, you can disable sessions by passing a JWT through to `auth.api.signOut(JWT: string)`
*/
async signOut(): Promise<{ error: Error | null }> {
this._removeSession()
this._notifyAllSubscribers('SIGNED_OUT')
// moved below...
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove these comments too

@inian inian requested a review from phamhieu April 10, 2021 15:17
src/GoTrueClient.ts Outdated Show resolved Hide resolved
@phamhieu
Copy link
Member

Good catch! @burggraf Thank you

Comment on lines +320 to +324
if (error) {
return { error }
} else {
return { error: null }
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you revert these changes

@phamhieu
Copy link
Member

I implemented the fix here

thanks @burggraf

@phamhieu phamhieu closed this Apr 12, 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 this pull request may close these issues.

Bug: signOut function is not completing and thus not creating logout events in log table
3 participants