Module: DoubleAuthEngine::PasswordResetsControllerMixin::InstanceMethods

Defined in:
lib/double_auth_engine/controllers/password_resets_controller_mixin.rb

Instance Method Summary collapse

Instance Method Details

#createObject



16
17
18
19
20
21
22
23
24
# File 'lib/double_auth_engine/controllers/password_resets_controller_mixin.rb', line 16

def create
  @user = User.find_by_email(params[:email])
  if @user
    @user.deliver_password_reset_instructions!
    redirect_to root_url, :notice => 'Instructions to reset your password have been emailed to you. Please check your email.'
  else
    redirect_to new_password_reset_url, :notice => 'No user was found with that email address'
  end
end

#editObject



26
27
28
# File 'lib/double_auth_engine/controllers/password_resets_controller_mixin.rb', line 26

def edit
  render :layout => false
end

#newObject



12
13
14
# File 'lib/double_auth_engine/controllers/password_resets_controller_mixin.rb', line 12

def new
  render :layout => false
end

#updateObject



30
31
32
33
34
35
36
37
38
39
# File 'lib/double_auth_engine/controllers/password_resets_controller_mixin.rb', line 30

def update
  @user.password              = params[:password]
  @user.password_confirmation = params[:password]
  if @user.save
    flash[:success] = "Your password was successfully updated"
    redirect_to root_url
  else
    render :action => :edit
  end
end