Skip to content

Commit f768878

Browse files
committed
Close existing session if another login attempt instead of throwing error.
1 parent ddc93b4 commit f768878

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/talk/client/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export class TalkClient
113113
}
114114

115115
async login(credential: OAuthCredential): AsyncCommandResult<LoginResult> {
116-
if (this.logon) throw new Error('Already logon');
116+
if (this.logon) this.close();
117117

118118
// Create session
119119
const sessionRes = await this._sessionFactory.createSession(this.configuration);

0 commit comments

Comments
 (0)