Method: Maestrano::SSO::Session#initialize

Defined in:
lib/maestrano/sso/session.rb

#initialize(session) ⇒ Session

Returns a new instance of Session.



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/maestrano/sso/session.rb', line 23

def initialize(session)
  self.session = session
  if (self.session = session)
    begin
      if mno_session = (self.session[:maestrano] || self.session['maestrano'])
        decrypted_session = JSON.parse(Base64.decode64(mno_session))
        self.uid = decrypted_session['uid']
        self.session_token = decrypted_session['session']
        self.recheck = Time.iso8601(decrypted_session['session_recheck'])
        self.group_uid = decrypted_session['group_uid']
      end
    rescue
    end
  end
end