Skip to content

Commit

Permalink
Remove unnecessary check for listSessions response
Browse files Browse the repository at this point in the history
  • Loading branch information
tolgahan-arikan committed Sep 11, 2024
1 parent fd3c1a1 commit e457330
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions packages/waas/src/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,10 +368,7 @@ export class SequenceWaaS {
// if we can fetch sessions from API, then we are signed in
// if not and error is the related session error, then we drop the session
try {
const sessions = await this.listSessions()
if (sessions.length > 0) {
return
}
await this.listSessions()
} catch (error) {
if (error instanceof WebrpcEndpointError && error.cause === 'session invalid or not found') {
await this.dropSession({ sessionId: await this.waas.getSessionId(), strict: false })
Expand Down

0 comments on commit e457330

Please sign in to comment.