Use entity update method rather than query. Fixed password reset form action.

This commit is contained in:
mikestefanello 2022-01-09 21:30:09 -05:00
parent acd38c8205
commit d412e06dad
4 changed files with 7 additions and 8 deletions

View file

@ -47,11 +47,10 @@ func (c *VerifyEmail) Get(ctx echo.Context) error {
// Verify the user, if needed
if !usr.Verified {
err = c.Container.ORM.User.
usr, err = usr.
Update().
SetVerified(true).
Where(user.ID(usr.ID)).
Exec(ctx.Request().Context())
Save(ctx.Request().Context())
if err != nil {
return c.Fail(ctx, err, "failed to set user as verified")