Module: NulogySSO::ControllerHelper

Extended by:
ActiveSupport::Concern
Defined in:
lib/nulogy_sso/controller_helper.rb

Overview

A mix-in that is intended to enhance a controller with NulogySSO authentication code. It is recommended to ‘include NulogySSO::ControllerHelper` in your ApplicationController.

Instance Method Summary collapse

Instance Method Details

#authenticate_sso_userObject



18
19
20
21
22
23
24
# File 'lib/nulogy_sso/controller_helper.rb', line 18

def authenticate_sso_user
  raw_token = CookieTokenStore.new(request, response).fetch
  return NulogySSO.handle_unauthenticated_request.call(self) if raw_token.blank?

  @current_user = Authenticator.new.authenticated_user(raw_token)
  return NulogySSO.handle_unauthenticated_request.call(self) if @current_user.blank?
end

#store_previous_url_in_sessionObject



26
27
28
# File 'lib/nulogy_sso/controller_helper.rb', line 26

def store_previous_url_in_session
  session[:previous_request_url] = request.url unless current_user
end