Class: Iron::PasswordsController

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

Instance Method Summary collapse

Instance Method Details

#createObject



11
12
13
14
15
16
17
# File 'app/controllers/iron/passwords_controller.rb', line 11

def create
  if (person = Person.find_by(email_address: params[:email_address])) && person.active?
    Iron::PasswordsMailer.reset(person.user).deliver_later
  end

  redirect_to , notice: t("iron.passwords.notifications.reset_instructions_sent")
end

#editObject



19
20
# File 'app/controllers/iron/passwords_controller.rb', line 19

def edit
end

#newObject



8
9
# File 'app/controllers/iron/passwords_controller.rb', line 8

def new
end

#updateObject



22
23
24
25
26
27
28
# File 'app/controllers/iron/passwords_controller.rb', line 22

def update
  if @person.update(params.permit(:password, :password_confirmation))
    redirect_to , notice: t("iron.passwords.notifications.reset_success")
  else
    redirect_to edit_password_url(params[:token]), alert: t("iron.passwords.alerts.passwords_mismatch")
  end
end