summaryrefslogtreecommitdiff
path: root/app/services/application/change_password.rb
blob: c273d7cc9d429016448f21834ec2e77adb118494 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
class ChangePassword
  def initialize(context, current_user = context.current_user)
    @context = context
    @current_user = current_user
  end

  def run(password, password_confirmation)
    if @current_user.change_password(password, password_confirmation)
      @context.password_changed(@current_user)
    else
      @context.password_changed_failed(@current_user)
    end
  end
end