Fix logic update form

parent 6492bb29
Pipeline #922 canceled with stages
in 0 seconds
...@@ -7,7 +7,7 @@ class UsersController < ApplicationController ...@@ -7,7 +7,7 @@ class UsersController < ApplicationController
end end
def update def update
user_params[:password] = current_user.password_digest if user_params[:password].blank? user_params.delete(:password) if user_params[:password].blank?
if BCrypt::Password.new(current_user.password_digest) != condition_update[:oldpassword] if BCrypt::Password.new(current_user.password_digest) != condition_update[:oldpassword]
flash.now[:danger] = 'Old Password is mismatch' flash.now[:danger] = 'Old Password is mismatch'
else else
...@@ -24,10 +24,6 @@ class UsersController < ApplicationController ...@@ -24,10 +24,6 @@ class UsersController < ApplicationController
private private
def validate_oldpass
end
def sign_in_validation def sign_in_validation
return if signed_in? return if signed_in?
flash[:warning] = "Please Sign In..." flash[:warning] = "Please Sign In..."
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment