From 471cc4909c8b5a5d3b546c12ab04c5de9923b342 Mon Sep 17 00:00:00 2001 From: Michael Quigley Date: Fri, 16 Feb 2024 16:35:42 -0500 Subject: [PATCH] logging (#191) --- controller/resetToken.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/controller/resetToken.go b/controller/resetToken.go index c75550a6..f00a3ba3 100644 --- a/controller/resetToken.go +++ b/controller/resetToken.go @@ -14,11 +14,7 @@ func newResetTokenHandler() *resetTokenHandler { } func (handler *resetTokenHandler) Handle(params account.ResetTokenParams, principal *rest_model_zrok.Principal) middleware.Responder { - if params.Body.EmailAddress == "" { - logrus.Error("missing email") - return account.NewResetTokenNotFound() - } - logrus.Infof("received token reset request for email '%v'", params.Body.EmailAddress) + logrus.Infof("received token regeneration request for email '%v'", principal.Email) if params.Body.EmailAddress != principal.Email { logrus.Errorf("mismatched account '%v' for '%v'", params.Body.EmailAddress, principal.Email) @@ -61,7 +57,7 @@ func (handler *resetTokenHandler) Handle(params account.ResetTokenParams, princi return account.NewResetTokenInternalServerError() } - logrus.Infof("reset token for '%v'", a.Email) + logrus.Infof("regenerated token '%v' for '%v'", a.Token, a.Email) return account.NewResetTokenOK().WithPayload(&account.ResetTokenOKBody{Token: token}) }