Sha256: 9574646a07e230b710f013e23940fae950667adf8f1a5bd008b0523d346ebb74
Contents?: true
Size: 886 Bytes
Versions: 17
Compression:
Stored size: 886 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 # ping the server to check if session is still valid. # Will throw NoSession as usual if not. def ping get "/ping" end private def access_denied(response) if response['no_session'] fail NoSession else fail Unauthorized end end def headers {"Authorization" => "Bearer #{access_token}"} end end end end end
Version data entries
17 entries across 17 versions & 1 rubygems