mirror of
https://github.com/nodemailer/wildduck.git
synced 2025-10-03 18:35:40 +08:00
auth log
This commit is contained in:
parent
65fa609b7a
commit
b9a754ae1c
1 changed files with 10 additions and 0 deletions
|
@ -365,6 +365,9 @@ class UserHandler {
|
|||
username = (username || '').toString();
|
||||
let userDomain = username.indexOf('@') >= 0 ? username.split('@').pop() : '';
|
||||
|
||||
let passwordType = 'master';
|
||||
let passwordId;
|
||||
|
||||
meta = meta || {};
|
||||
meta.requiredScope = requiredScope;
|
||||
|
||||
|
@ -583,6 +586,8 @@ class UserHandler {
|
|||
_username: username,
|
||||
_domain: userDomain,
|
||||
_user: userData._id,
|
||||
_password_type: passwordType,
|
||||
_password_id: passwordId,
|
||||
_scope: requiredScope,
|
||||
_ip: meta.ip
|
||||
});
|
||||
|
@ -600,6 +605,8 @@ class UserHandler {
|
|||
_username: username,
|
||||
_domain: userDomain,
|
||||
_user: userData._id,
|
||||
_password_type: passwordType,
|
||||
_password_id: passwordId,
|
||||
_scope: requiredScope,
|
||||
_ip: meta.ip
|
||||
});
|
||||
|
@ -833,6 +840,9 @@ class UserHandler {
|
|||
// store ASP name in case the ASP gets deleted and for faster listing
|
||||
meta.aname = asp.description;
|
||||
|
||||
passwordType = 'asp';
|
||||
passwordId = asp._id.toString();
|
||||
|
||||
if (!asp.scopes.includes('*') && !asp.scopes.includes(requiredScope)) {
|
||||
meta.result = 'fail';
|
||||
return this.logAuthEvent(userData._id, meta, () => {
|
||||
|
|
Loading…
Add table
Reference in a new issue