app/controllers/users/passwords_controller.rb
def update
      super do |user|
        if user.errors.include?(:reset_password_token)
          redirect_to(new_user_password_path, alert: invalid_token_error) && return
        end
      end
    end
# Intercept the errors and if there is any on the reset_password_token field, redirect back
# to the reset password page. Otherwise, Devise will not show the error in the edit page,
# because it belongs to a hidden field.
Intercept the errors and if there is any on the reset_password_token field, redirect back
to the reset password page. Otherwise, Devise will not show the error in the edit page,
because it belongs to a hidden field.
Intercept the errors and if there is any on the reset_password_token field redirect back to the reset password page . Otherwise Devise will not show the error in the edit page because it belongs to a hidden field .
def update
      super do |user|
        if user.errors.include?(:reset_password_token)
          redirect_to(new_user_password_path, alert: invalid_token_error) && return
        end
      end
    end
def update super do | user | if user . errors . include? ( :reset_password_token ) redirect_to ( new_user_password_path , alert : invalid_token_error ) && return end end end
Intercept the errors and if there is any on the reset_password_token field, redirect back
to the reset password page.
Intercept the errors and if there is any on the reset_password_token field redirect back to the reset password page .