mirror of
https://github.com/phishingclub/phishingclub.git
synced 2026-10-14 03:00:46 +02:00
add unified login audit log
Signed-off-by: RonniSkansing <rskansing@gmail.com>
This commit is contained in:
1 parent
895c7b9fdd
commit
d3270239d6
1 file changed
+7
@@ -204,6 +204,13 @@ func (s *Session) Create(
|
||||
s.Logger.Errorw("failed to get session after creating it", "error", err)
|
||||
return nil, errs.Wrap(err)
|
||||
}
|
||||
// a session is only created after all login checks have passed,
|
||||
// including MFA and SSO, so this event marks a fully completed login
|
||||
ae := NewAuditEvent("User.Login", createdSession)
|
||||
if username, err := user.Username.Get(); err == nil {
|
||||
ae.Details["username"] = username.String()
|
||||
}
|
||||
s.AuditLogAuthorized(ae)
|
||||
return createdSession, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user