Module: Cas::Authentication::InstanceMethods
- Defined in:
- lib/bcms_cas/authentication.rb
Overview
Each instance of the controller will gain these methods.
Instance Method Summary collapse
-
#login_from_cas_ticket ⇒ Object
Attempts to set the current user based on the session attribute set by CAS.
Instance Method Details
#login_from_cas_ticket ⇒ Object
Attempts to set the current user based on the session attribute set by CAS.
30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/bcms_cas/authentication.rb', line 30 def login_from_cas_ticket logger.debug "Checking for cas login. The current_user is '#{@current_user.login}'." if @current_user if session[:cas_user] user = CasUser.new(:login=>session[:cas_user]) # Having to set both of these feels very duplicative. Ideally I would like a way # to set only once, but calling current_user= has side effects. @current_user = User.current = user logger.debug "CasUser information found in session. Setting current_user as '#{user.login}" if @current_user end @current_user end |