Module: IntercomApp::LoginProtection
- Extended by:
- ActiveSupport::Concern
- Included in:
- AuthenticatedController
- Defined in:
- lib/intercom-app/login_protection.rb
Instance Method Summary collapse
- #app_session ⇒ Object
-
#intercom_session ⇒ Object
included do rescue_from ActiveResource::UnauthorizedAccess, :with => :close_session end.
Instance Method Details
#app_session ⇒ Object
19 20 21 22 |
# File 'lib/intercom-app/login_protection.rb', line 19 def app_session return unless session[:intercom] @app_session ||= IntercomApp::SessionRepository.retrieve(session[:intercom]) end |
#intercom_session ⇒ Object
included do
rescue_from ActiveResource::UnauthorizedAccess, :with => :close_session
end
9 10 11 12 13 14 15 16 17 |
# File 'lib/intercom-app/login_protection.rb', line 9 def intercom_session if app_session begin yield end else redirect_to_login end end |