saasufy-components 1.1.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/socket.js +2 -7
package/package.json
CHANGED
package/socket.js
CHANGED
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
import { create } from '/node_modules/socketcluster-client/socketcluster-client.min.js';
|
|
2
2
|
|
|
3
|
-
const DEFAULT_AUTH_TOKEN_NAME = 'saasufy.authToken';
|
|
4
|
-
|
|
5
3
|
let globalSocket;
|
|
6
4
|
|
|
7
5
|
let urlPartsRegExp = /(^[^:]+):\/\/([^:\/]*)(:[0-9]*)?(\/.*)/;
|
|
8
6
|
|
|
9
7
|
export function createGlobalSocket(options) {
|
|
10
|
-
globalSocket = create({
|
|
11
|
-
authTokenName: DEFAULT_AUTH_TOKEN_NAME,
|
|
12
|
-
...options
|
|
13
|
-
});
|
|
8
|
+
globalSocket = create({ ...options });
|
|
14
9
|
return globalSocket;
|
|
15
10
|
}
|
|
16
11
|
|
|
@@ -64,7 +59,7 @@ export class SocketProvider extends HTMLElement {
|
|
|
64
59
|
}
|
|
65
60
|
|
|
66
61
|
createSocket() {
|
|
67
|
-
let authTokenName = this.getAttribute('auth-token-name') ||
|
|
62
|
+
let authTokenName = this.getAttribute('auth-token-name') || null;
|
|
68
63
|
let url = this.getAttribute('url') || '';
|
|
69
64
|
let urlOptions;
|
|
70
65
|
let matchedList = url.match(urlPartsRegExp);
|