Class: FoundersToolkit::Auth::Securable::SessionsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- FoundersToolkit::Auth::Securable::SessionsController
- Includes:
- Controller
- Defined in:
- lib/founders_toolkit/auth/securable/sessions_controller.rb
Direct Known Subclasses
Instance Method Summary collapse
Methods included from Controller
Instance Method Details
#create ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/founders_toolkit/auth/securable/sessions_controller.rb', line 11 def create @user = User.find_by(email: params[:email]) if @user&.authenticate(params[:password]) session[:user_id] = @user.id redirect_to after_login_path else redirect_to new_session_path, alert: 'We could not sign you in with those credentials.' end end |
#destroy ⇒ Object
22 23 24 25 |
# File 'lib/founders_toolkit/auth/securable/sessions_controller.rb', line 22 def destroy reset_session redirect_to after_logout_path end |
#new ⇒ Object
9 |
# File 'lib/founders_toolkit/auth/securable/sessions_controller.rb', line 9 def new; end |