Store auth info in a JWT token in a cookie

This commit is contained in:
Ken-Håvard Lieng 2016-01-15 02:27:30 +01:00
parent 3e0a1be6bc
commit fb54d4966c
18 changed files with 499 additions and 331 deletions

View file

@ -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({