Skip to content

Commit

Permalink
logging (#191)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelquigley committed Feb 16, 2024
1 parent 36067f5 commit 471cc49
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions controller/resetToken.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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})
}

0 comments on commit 471cc49

Please sign in to comment.