Browse Source

modding #1858

(cherry picked from commit 2abeb38d64)
tags/v0.10.5.2
Shaun 2 years ago
committed by Big Bad Waffle
parent
commit
68439acc02
1 changed files with 13 additions and 0 deletions
  1. +13
    -0
      src/server/components/auth.js

+ 13
- 0
src/server/components/auth.js View File

@@ -260,6 +260,7 @@ module.exports = {

if (credentials.username === '' || credentials.password === '') {
msg.callback(messages.login.allFields);

return;
}

@@ -279,6 +280,18 @@ module.exports = {
msg.callback(messages.login.incorrect);
return;
}

const emBeforeLogin = {
obj: this.obj,
success: true,
msg: null
};
await eventEmitter.emit('onBeforeLogin', emBeforeLogin);
if (!emBeforeLogin.success) {
msg.callback(emBeforeLogin.msg);

return;
}
this.username = username;
await cons.logOut(this.obj);


Loading…
Cancel
Save