Skip to content

Commit

Permalink
Fix authenticate ws before connection bug
Browse files Browse the repository at this point in the history
  • Loading branch information
joepio committed Dec 27, 2022
1 parent ef25b4d commit 9955f94
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ export class Store {
if (agent) {
setCookieAuthentication(this, agent);
this.webSockets.forEach(ws => {
authenticate(ws, this);
ws.readyState === ws.OPEN && authenticate(ws, this);
});
this.resources.forEach(r => {
if (r.isUnauthorized()) {
Expand All @@ -425,7 +425,7 @@ export class Store {
public setServerUrl(url: string): void {
tryValidURL(url);

if (url.substr(-1) === '/') {
if (url.substring(-1) === '/') {
throw Error('baseUrl should not have a trailing slash');
}

Expand Down

0 comments on commit 9955f94

Please sign in to comment.