Webatrice: fix login bugs (#4557)

* fix login after failed connection attempts, limit connection attempt time

* fix register hashed password and salt

* add feature detection and Unsupported Browser screen

* nit

Co-authored-by: Jeremy Letto <jeremy.letto@datasite.com>
This commit is contained in:
Jeremy Letto 2022-02-04 13:07:15 -06:00 committed by GitHub
parent 81d031ca0f
commit bb16ae09ef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 104 additions and 18 deletions

View file

@ -4,6 +4,7 @@ import { ServerStatus, StatusEnum, WebSocketConnectOptions } from 'types';
import { KeepAliveService } from './KeepAliveService';
import { WebClient } from '../WebClient';
import { SessionPersistence } from '../persistence';
export class WebSocketService {
private socket: WebSocket;
@ -60,7 +61,10 @@ export class WebSocketService {
const socket = new WebSocket(url);
socket.binaryType = 'arraybuffer';
const connectionTimer = setTimeout(() => socket.close(), this.keepalive);
socket.onopen = () => {
clearTimeout(connectionTimer);
this.updateStatus(StatusEnum.CONNECTED, 'Connected');
this.keepAliveService.startPingLoop(this.keepalive, (pingReceived: Function) => {
@ -79,6 +83,7 @@ export class WebSocketService {
socket.onerror = () => {
this.updateStatus(StatusEnum.DISCONNECTED, 'Connection Failed');
SessionPersistence.connectionFailed();
};
socket.onmessage = (event: MessageEvent) => {