~netlandish/gobwebs

dd1a3458680d839b406a1f014884cd6b3c867d80 — Peter Sanchez 2 years ago 4f1ba2f
Reverting 505272b902ba - what in the world was I thinking?
1 files changed, 0 insertions(+), 19 deletions(-)

M accounts/routes.go
M accounts/routes.go => accounts/routes.go +0 -19
@@ 517,25 517,6 @@ func (s *Service) ForgotPasswordConfPOST(c echo.Context) error {
		return err
	}

	if !user.IsVerified() {
		// To be here they had to have verified the email.
		ctx := database.Context(c.Request().Context(), gctx.Server.DB)
		if err := database.WithTx(ctx, nil, func(tx *sql.Tx) error {
			// Null any current pending email changes
			_, err := tx.ExecContext(ctx, `
				UPDATE "users"
				SET is_verified=true
				WHERE id=$1`,
				user.GetID())
			if err != nil {
				return err
			}
			return nil
		}); err != nil {
			return err
		}
	}

	if err := s.fetch.ProcessSuccessfulPasswordReset(c); err != nil {
		return err
	}