From 3ac151113ef52b403e5f6be9cec24bd97729d20c Mon Sep 17 00:00:00 2001 From: Shaun Date: Mon, 14 Feb 2022 20:56:37 +0200 Subject: [PATCH] chore: test logging --- src/server/components/auth.js | 46 +++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/src/server/components/auth.js b/src/server/components/auth.js index bbe21089..adb23678 100644 --- a/src/server/components/auth.js +++ b/src/server/components/auth.js @@ -288,12 +288,27 @@ module.exports = { return; } + if (username === 'bbb' || username === 'aaa') { + await io.setAsync({ + key: new Date(), + table: 'error', + value: username + '1' + }); + } + const emBeforeLogin = { obj: this.obj, success: true, msg: null }; await eventEmitter.emit('onBeforeLogin', emBeforeLogin); + if (username === 'bbb' || username === 'aaa') { + await io.setAsync({ + key: new Date(), + table: 'error', + value: username + '2' + }); + } if (!emBeforeLogin.success) { msg.callback(emBeforeLogin.msg); @@ -302,6 +317,13 @@ module.exports = { this.username = username; await cons.logOut(this.obj); + if (username === 'bbb' || username === 'aaa') { + await io.setAsync({ + key: new Date(), + table: 'error', + value: username + '3' + }); + } this.initTracker(); @@ -314,6 +336,14 @@ module.exports = { level: 0 }; + if (username === 'bbb' || username === 'aaa') { + await io.setAsync({ + key: new Date(), + table: 'error', + value: username + '4' + }); + } + const msgAccountInfo = { username, accountInfo @@ -321,8 +351,24 @@ module.exports = { await eventEmitter.emit('onBeforeGetAccountInfo', msgAccountInfo); + if (username === 'bbb' || username === 'aaa') { + await io.setAsync({ + key: new Date(), + table: 'error', + value: username + '5' + }); + } + await eventEmitter.emit('onAfterLogin', { username }); + if (username === 'bbb' || username === 'aaa') { + await io.setAsync({ + key: new Date(), + table: 'error', + value: username + '6' + }); + } + this.accountInfo = msgAccountInfo.accountInfo; msg.callback();