Sha256: b918a27e5ea48a1a5b3e22af3aef37951ca0df7ce90724e745936a305504076b

Contents?: true

Size: 553 Bytes

Versions: 2

Compression:

Stored size: 553 Bytes

Contents

module Roqua
  module CoreApi
    module Sessions
      class OAuthSession < AuthSession
        attr_reader :access_token

        def initialize(access_token:, **additional_arguments)
          @access_token = access_token
          super additional_arguments
        end

        def logout_url(return_to:)
          "#{core_site}/session/destroy?token=#{access_token}&return_to=#{CGI.escape return_to}"
        end

        private

        def headers
          {"Authorization" => "Bearer #{access_token}"}
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
roqua-core-api-0.0.21 lib/roqua/core_api/sessions/oauth_session.rb
roqua-core-api-0.0.20 lib/roqua/core_api/sessions/oauth_session.rb