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

@ -3,7 +3,7 @@ import { Room, StatusEnum, User, WebSocketConnectReason } from 'types';
import { SessionCommands } from '../commands';
import { RoomPersistence, SessionPersistence } from '../persistence';
import { ProtobufEvents } from '../services/ProtobufService';
import { passwordSaltSupported } from '../utils';
import { generateSalt, passwordSaltSupported } from '../utils';
import webClient from '../WebClient';
export const SessionEvents: ProtobufEvents = {
@ -130,11 +130,8 @@ function serverIdentification(info: ServerIdentificationData) {
}
break;
case WebSocketConnectReason.REGISTER:
if (passwordSaltSupported(serverOptions, webClient)) {
SessionCommands.requestPasswordSalt();
} else {
SessionCommands.register();
}
const passwordSalt = passwordSaltSupported(serverOptions, webClient) ? generateSalt() : null;
SessionCommands.register(passwordSalt);
break;
case WebSocketConnectReason.ACTIVATE_ACCOUNT:
if (passwordSaltSupported(serverOptions, webClient)) {