Class: ReviseAuth::SessionsController
- Inherits:
-
ReviseAuthController
- Object
- ApplicationController
- ReviseAuthController
- ReviseAuth::SessionsController
- Defined in:
- app/controllers/revise_auth/sessions_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'app/controllers/revise_auth/sessions_controller.rb', line 9 def create if (user = User.authenticate_by(email: params[:email], password: params[:password])) login(user) redirect_to resolve_after_login_path else flash[:alert] = t(".invalid_email_or_password") render :new, status: :unprocessable_entity end end |
#destroy ⇒ Object
19 20 21 22 |
# File 'app/controllers/revise_auth/sessions_controller.rb', line 19 def destroy logout redirect_to root_path end |
#new ⇒ Object
6 7 |
# File 'app/controllers/revise_auth/sessions_controller.rb', line 6 def new end |