commit 725a39ee5244f2a40a9bf1bbf93181f3f17820b6
parent 56bac4cdc444f6e111a37c5e7254a2fa3a8023cf
Author: n0tr1v <n0tr1v@protonmail.com>
Date: Sat, 3 Dec 2022 17:14:05 -0500
improve security logs
Diffstat:
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/pkg/database/tableSecurityLogs.go b/pkg/database/tableSecurityLogs.go
@@ -25,6 +25,7 @@ const (
UsernameChangedSecurityLog
ChangeDuressPasswordSecurityLog
ChangeSecretPhraseSecurityLog
+ PasswordRecoverySecurityLog
)
func getMessageForType(typ int64) string {
@@ -49,6 +50,8 @@ func getMessageForType(typ int64) string {
return "Username changed"
case ChangeSecretPhraseSecurityLog:
return "Secret phrase changed"
+ case PasswordRecoverySecurityLog:
+ return "Password recovery"
}
return ""
}
diff --git a/pkg/web/handlers/handlers.go b/pkg/web/handlers/handlers.go
@@ -1198,7 +1198,7 @@ func ForgotPasswordHandler(c echo.Context) error {
logrus.Error(err)
}
c.SetCookie(createSessionCookie("", -1))
- database.CreateSecurityLog(user.ID, database.ChangePasswordSecurityLog)
+ database.CreateSecurityLog(user.ID, database.PasswordRecoverySecurityLog)
partialRecovery2Cache.Delete(partialRecovery2Cookie.Value)
c.SetCookie(createPartialRecovery2Cookie("", -1))