This commit is contained in:
Michael Quigley 2024-02-16 16:35:42 -05:00
parent 36067f5e91
commit 471cc4909c
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62

View File

@ -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})
}