Class: Admin::PasswordResetsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Admin::PasswordResetsController
- Defined in:
- app/controllers/admin/password_resets_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'app/controllers/admin/password_resets_controller.rb', line 11 def create @user = SpudUser.find_by_email(params[:email]) if @user @user.reset_perishable_token! TbCoreMailer.forgot_password_notification(@user, admin_password_reset_url(@user.perishable_token)).deliver_later flash[:notice] = "Instructions to reset your password have been emailed to you. " + "Please check your email." redirect_to admin_login_path else flash.now[:error] = "No user was found with that email address" render 'index' end end |
#index ⇒ Object
7 8 9 |
# File 'app/controllers/admin/password_resets_controller.rb', line 7 def index end |
#show ⇒ Object
25 26 27 |
# File 'app/controllers/admin/password_resets_controller.rb', line 25 def show end |
#update ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 |
# File 'app/controllers/admin/password_resets_controller.rb', line 29 def update @user.password = params[:spud_user][:password] @user.password_confirmation = params[:spud_user][:password_confirmation] if @user.save SpudUserSession.create(@user) flash[:notice] = "Password successfully updated" redirect_to admin_login_path else render 'show' end end |