Skip to content

Commit 2deb560

Browse files
authored
fix(auth): suppress getsession warning when getuser is called first (#1898)
1 parent 84c877f commit 2deb560

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/core/auth-js/src/GoTrueClient.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1708,6 +1708,10 @@ export default class GoTrueClient {
17081708
return await this._getUser()
17091709
})
17101710

1711+
if (result.data.user) {
1712+
this.suppressGetSessionWarning = true
1713+
}
1714+
17111715
return result
17121716
}
17131717

@@ -2783,6 +2787,8 @@ export default class GoTrueClient {
27832787
private async _removeSession() {
27842788
this._debug('#_removeSession()')
27852789

2790+
this.suppressGetSessionWarning = false
2791+
27862792
await removeItemAsync(this.storage, this.storageKey)
27872793
await removeItemAsync(this.storage, this.storageKey + '-code-verifier')
27882794
await removeItemAsync(this.storage, this.storageKey + '-user')

0 commit comments

Comments
 (0)