Class: ClientManager::PasswordsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/client_manager/passwords_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#authenticate_superadmin, #authenticate_user, #client_manager_current_user

Instance Method Details

#changeObject



6
7
8
# File 'app/controllers/client_manager/passwords_controller.rb', line 6

def change

end

#change_password_attemptObject



10
11
12
13
14
15
16
17
18
19
# File 'app/controllers/client_manager/passwords_controller.rb', line 10

def change_password_attempt
  if params[:new_password] == params[:confirm_new_password]
    client_manager_current_user.update(password: params[:new_password], password_changed: true)
    flash[:notice] = "Successfully changed password"
    redirect_to 
  else
    flash[:error] = "Passwords do not match"
    render 'change'
  end
end

#password_change_paramsObject



22
23
24
# File 'app/controllers/client_manager/passwords_controller.rb', line 22

def password_change_params
  params.permit(:new_password, :confirm_new_password)
end