Class: ActionAuth::Identity::PasswordResetsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/action_auth/identity/password_resets_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



13
14
15
16
17
18
19
20
# File 'app/controllers/action_auth/identity/password_resets_controller.rb', line 13

def create
  if @user = ActionAuth::User.find_by(email: params[:email], verified: true)
    send_password_reset_email
    redirect_to , notice: "Check your email for reset instructions"
  else
    redirect_to , alert: "You can't reset your password until you verify your email"
  end
end

#editObject



10
11
# File 'app/controllers/action_auth/identity/password_resets_controller.rb', line 10

def edit
end

#newObject



7
8
# File 'app/controllers/action_auth/identity/password_resets_controller.rb', line 7

def new
end

#updateObject



22
23
24
25
26
27
28
# File 'app/controllers/action_auth/identity/password_resets_controller.rb', line 22

def update
  if @user.update(user_params)
    redirect_to , notice: "Your password was reset successfully. Please sign in"
  else
    render :edit, status: :unprocessable_entity
  end
end