Class: SessionsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- SessionsController
- Defined in:
- app/controllers/sessions_controller.rb
Overview
Handles log in / log out
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'app/controllers/sessions_controller.rb', line 7 def create self.user_swipecard = params.require(:user_swipecard) if @current_user redirect_to :search, notice: 'Logged in' # rubocop:todo Rails/I18nLocaleTexts else redirect_to :search, alert: 'Sorry, that swipecard could not be found. Please update your details in Sequencescape.' # rubocop:todo Rails/I18nLocaleTexts end end |
#destroy ⇒ Object
17 18 19 20 21 22 |
# File 'app/controllers/sessions_controller.rb', line 17 def destroy reset_session [:user_name] = nil [:user_id] = nil redirect_to :search, notice: 'Logged out' # rubocop:todo Rails/I18nLocaleTexts end |