Class: DoorMat::ReconfirmPasswordController

Inherits:
ApplicationController show all
Defined in:
app/controllers/door_mat/reconfirm_password_controller.rb

Instance Method Summary collapse

Methods included from Controller

#config_url_redirect, #handle_unverified_request, #lockdown, #main_app_root_url, #protected_by_password_less_session, #require_confirmed_email, #require_password_reconfirm, #require_valid_session, #sign_out, #update_session_last_activity_time

Instance Method Details

#createObject



16
17
18
19
20
21
22
23
24
# File 'app/controllers/door_mat/reconfirm_password_controller.rb', line 16

def create
  password = params[:password]
  if DoorMat::Session.current_session.reconfirm_password(password)
    destination_of_redirect = session.delete(:redirect_to) || config_url_redirect(:sign_in_success_url)
    redirect_to destination_of_redirect
  else
    render :new
  end
end

#newObject



3
4
5
6
7
8
9
10
11
12
13
14
# File 'app/controllers/door_mat/reconfirm_password_controller.rb', line 3

def new
  @current_session_email = nil

  # Following a
  # require_password_reconfirm, provide the email associated with
  # the current session.
  # This convenience could be considered a leak of information
  # so it is disabled by default.
  if DoorMat.configuration.leak_email_address_at_reconfirm
    @current_session_email = DoorMat::Session.current_session.email.address
  end
end