From ea8acaff4cc943d5de405e234032f2d795bfe330 Mon Sep 17 00:00:00 2001 From: farhatahmad <35435341+farhatahmad@users.noreply.github.com> Date: Thu, 15 Aug 2019 13:20:55 -0400 Subject: [PATCH] Added extra check for reset password (#745) --- app/helpers/application_helper.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 29202d01..36959085 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -130,7 +130,9 @@ module ApplicationHelper end def can_reset_password - # Check if admin is editting user - Rails.application.routes.recognize_path(request.env['PATH_INFO'])[:action] == "edit_user" + # Check if admin is editting user and user is a greenlight account + Rails.configuration.enable_email_verification && + Rails.application.routes.recognize_path(request.env['PATH_INFO'])[:action] == "edit_user" && + @user.greenlight_account? end end