mirror of
https://github.com/openziti/zrok.git
synced 2025-01-03 12:39:07 +01:00
missing deferred rollback (#50)
This commit is contained in:
parent
27d1f390a5
commit
5fae000dad
@ -23,11 +23,14 @@ func (self *verifyHandler) Handle(params identity.VerifyParams) middleware.Respo
|
|||||||
logrus.Errorf("error starting transaction: %v", err)
|
logrus.Errorf("error starting transaction: %v", err)
|
||||||
return identity.NewVerifyInternalServerError().WithPayload(rest_model_zrok.ErrorMessage(err.Error()))
|
return identity.NewVerifyInternalServerError().WithPayload(rest_model_zrok.ErrorMessage(err.Error()))
|
||||||
}
|
}
|
||||||
|
defer func() { _ = tx.Rollback() }()
|
||||||
|
|
||||||
ar, err := str.FindAccountRequestWithToken(params.Body.Token, tx)
|
ar, err := str.FindAccountRequestWithToken(params.Body.Token, tx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logrus.Errorf("error finding account with token '%v': %v", params.Body.Token, err)
|
logrus.Errorf("error finding account with token '%v': %v", params.Body.Token, err)
|
||||||
return identity.NewVerifyNotFound()
|
return identity.NewVerifyNotFound()
|
||||||
}
|
}
|
||||||
|
|
||||||
return identity.NewVerifyOK().WithPayload(&rest_model_zrok.VerifyResponse{Email: ar.Email})
|
return identity.NewVerifyOK().WithPayload(&rest_model_zrok.VerifyResponse{Email: ar.Email})
|
||||||
} else {
|
} else {
|
||||||
logrus.Error("empty verification request")
|
logrus.Error("empty verification request")
|
||||||
|
Loading…
Reference in New Issue
Block a user