Class: Lobby::PasswordForgottenController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- Lobby::PasswordForgottenController
- Defined in:
- app/controllers/lobby/password_forgotten_controller.rb
Instance Method Summary collapse
- #check_token ⇒ Object
- #create ⇒ Object
- #new ⇒ Object
- #order_new_password ⇒ Object
- #password_forgotten_form_params ⇒ Object
Instance Method Details
#check_token ⇒ Object
35 36 37 38 39 40 41 42 43 |
# File 'app/controllers/lobby/password_forgotten_controller.rb', line 35 def check_token @token = params[:token] @password_forgotten_form = PasswordForgottenForm.new(@token) if @password_forgotten_form.user.blank? render :recover_password_auth false end end |
#create ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'app/controllers/lobby/password_forgotten_controller.rb', line 9 def create if @password_forgotten_form.submit(password_forgotten_form_params) flash[:success] = t('.notice.success') redirect_to log_in_url else render "new" end end |
#new ⇒ Object
6 7 |
# File 'app/controllers/lobby/password_forgotten_controller.rb', line 6 def new end |
#order_new_password ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'app/controllers/lobby/password_forgotten_controller.rb', line 18 def order_new_password if params[:email].present? @user = User.where( :email => params[:email] ).first if @user @user.send_password_reset # nothing special. Send always the same notice. so you can prevent from e-mail-guessing. else puts "*******************************" puts "An non-existing email was given" puts "*******************************" end flash[:success] = t( '.flash.success' ) redirect_to log_in_url end end |
#password_forgotten_form_params ⇒ Object
45 46 47 |
# File 'app/controllers/lobby/password_forgotten_controller.rb', line 45 def password_forgotten_form_params params.require(:password_forgotten_form).permit(:new_password, :new_password_confirmation) end |