Store auth info in a JWT token in a cookie
This commit is contained in:
parent
3e0a1be6bc
commit
fb54d4966c
18 changed files with 499 additions and 331 deletions
|
@ -2,16 +2,12 @@ import EventEmitter2 from 'eventemitter2';
|
|||
import Backoff from 'backo';
|
||||
|
||||
export default class Socket extends EventEmitter2 {
|
||||
constructor(host, uuid) {
|
||||
constructor(host) {
|
||||
super();
|
||||
|
||||
const protocol = window.location.protocol === 'https:' ? 'wss' : 'ws';
|
||||
this.url = `${protocol}://${host}/ws`;
|
||||
|
||||
if (uuid) {
|
||||
this.url += `?uuid=${uuid}`;
|
||||
}
|
||||
|
||||
this.connectTimeout = 20000;
|
||||
this.pingTimeout = 30000;
|
||||
this.backoff = new Backoff({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue