Sha256: 6bf0910ee804e1c8ed1458ad066c3336f53573deac0e734f73358082e8e7e5fc

Contents?: true

Size: 870 Bytes

Versions: 5

Compression:

Stored size: 870 Bytes

Contents

module Authlogic
  module Cas
    module ControllerActions
      module Session

        def new_cas_session
          redirect_to(cas_login_url) unless returning_from_cas?
        end

        def destroy_cas_session
          @user_session = ::Authlogic::Cas.authentication_model.find
          @user_session.destroy if @user_session
          redirect_to ::Authlogic::Cas.cas_client.logout_url
        end

        protected

        def returning_from_cas?
          params[:ticket] || request.referer =~ /^#{::Authlogic::Cas.cas_client.cas_base_url}/
        end


        def cas_login_url
          login_url_from_cas_client = ::Authlogic::Cas.cas_client.add_service_to_login_url(cas_service_url)
          redirect_url = ""# "&redirect=#{cas_return_to_url}"
          return "#{login_url_from_cas_client}#{redirect_url}"
        end

      end
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
authlogic_cloudfuji-0.9.4 lib/authlogic_cas/controller_actions/session.rb
authlogic_cloudfuji-0.9.3 lib/authlogic_cas/controller_actions/session.rb
authlogic_bushido-0.9.2 lib/authlogic_cas/controller_actions/session.rb
authlogic_bushido-0.9.1 lib/authlogic_cas/controller_actions/session.rb
authlogic_bushido-0.9 lib/authlogic_cas/controller_actions/session.rb