Sha256: 862cc72867aa468e7d4b9ea38e21e4fdc57a4dd36f0be73fa4ed5e29d884234c

Contents?: true

Size: 793 Bytes

Versions: 1

Compression:

Stored size: 793 Bytes

Contents

module Sso
  module Doorkeeper
    module AuthorizationsControllerMixin
      extend ActiveSupport::Concern
      include ::Sso::Logging

      included do
        after_action :after_grant_create, only: [:new, :create]
      end

    protected

      def after_grant_create
        debug { "AuthorizationsController#Create : after_action" }
        code_response = authorization.instance_variable_get("@response")
        if code_response
          warden_session = session["warden.user.user.session"]
          debug { "Sso::Session.update_master_with_grant - #{warden_session["sso_session_id"].inspect}, #{code_response.auth.token.inspect}" }
          Sso::Session.update_master_with_grant(warden_session["sso_session_id"], code_response.auth.token)
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
doorkeeper_sso-0.1.0.pre.alpha lib/sso/doorkeeper/authorizations_controller_mixin.rb