Fixes for passport local and allow empty password

This commit is contained in:
advplyr 2023-04-16 10:08:13 -05:00
parent 812395b21b
commit 7010a13648
10 changed files with 206 additions and 75 deletions

View file

@ -140,7 +140,7 @@ class SocketAuthority {
// When setting up a socket connection the user needs to be associated with a socket id
// for this the client will send a 'auth' event that includes the users API token
async authenticateSocket(socket, token) {
const user = await this.Server.auth.authenticateUser(token)
const user = await this.Server.db.users.find(u => u.token === token)
if (!user) {
Logger.error('Cannot validate socket - invalid token')
return socket.emit('invalid_token')