@@ -67,7 +67,7 @@ func (controller *UserController) loginHandler(c *gin.Context) {
6767
6868 if isLocked {
6969 tlog .App .Warn ().Str ("username" , req .Username ).Msg ("Account is locked due to too many failed login attempts" )
70- tlog .AuditLoginFailure (c , req .Username , "username" )
70+ tlog .AuditLoginFailure (c , req .Username , "username" , "account locked" )
7171 c .Writer .Header ().Add ("x-tinyauth-lock-locked" , "true" )
7272 c .Writer .Header ().Add ("x-tinyauth-lock-reset" , time .Now ().Add (time .Duration (remaining )* time .Second ).Format (time .RFC3339 ))
7373 c .JSON (429 , gin.H {
@@ -82,7 +82,7 @@ func (controller *UserController) loginHandler(c *gin.Context) {
8282 if userSearch .Type == "unknown" {
8383 tlog .App .Warn ().Str ("username" , req .Username ).Msg ("User not found" )
8484 controller .auth .RecordLoginAttempt (req .Username , false )
85- tlog .AuditLoginFailure (c , req .Username , "username" )
85+ tlog .AuditLoginFailure (c , req .Username , "username" , "user not found" )
8686 c .JSON (401 , gin.H {
8787 "status" : 401 ,
8888 "message" : "Unauthorized" ,
@@ -93,7 +93,7 @@ func (controller *UserController) loginHandler(c *gin.Context) {
9393 if ! controller .auth .VerifyUser (userSearch , req .Password ) {
9494 tlog .App .Warn ().Str ("username" , req .Username ).Msg ("Invalid password" )
9595 controller .auth .RecordLoginAttempt (req .Username , false )
96- tlog .AuditLoginFailure (c , req .Username , "username" )
96+ tlog .AuditLoginFailure (c , req .Username , "username" , "invalid password" )
9797 c .JSON (401 , gin.H {
9898 "status" : 401 ,
9999 "message" : "Unauthorized" ,
@@ -235,7 +235,7 @@ func (controller *UserController) totpHandler(c *gin.Context) {
235235 if ! ok {
236236 tlog .App .Warn ().Str ("username" , context .Username ).Msg ("Invalid TOTP code" )
237237 controller .auth .RecordLoginAttempt (context .Username , false )
238- tlog .AuditLoginFailure (c , context .Username , "totp" )
238+ tlog .AuditLoginFailure (c , context .Username , "totp" , "invalid totp code" )
239239 c .JSON (401 , gin.H {
240240 "status" : 401 ,
241241 "message" : "Unauthorized" ,
0 commit comments