Class: SessionsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- SessionsController
- Defined in:
- lib/generators/thincloud/auth/templates/sessions_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'lib/generators/thincloud/auth/templates/sessions_controller.rb', line 7 def create user = warden.authenticate! if user redirect_to after_login_path, notice: "Logged In" else flash.now.alert = warden. render :new end end |
#destroy ⇒ Object
17 18 19 20 |
# File 'lib/generators/thincloud/auth/templates/sessions_controller.rb', line 17 def destroy warden.logout redirect_to after_logout_path, notice: "Logged out" end |
#new ⇒ Object
3 4 5 |
# File 'lib/generators/thincloud/auth/templates/sessions_controller.rb', line 3 def new flash.now.alert = warden. if warden..present? end |