Module: Parse::API::Sessions

Included in:
Client
Defined in:
lib/parse/api/sessions.rb

Overview

Defines the Session class interface for the Parse REST API

Instance Method Summary collapse

Instance Method Details

#fetch_session(session_token, **opts) ⇒ Parse::Response

Fetch a session record for a given session token.

Parameters:

  • session_token (String)

    an active session token.

  • opts (Hash)

    additional options to pass to the Client request.

Returns:


16
17
18
19
20
21
22
# File 'lib/parse/api/sessions.rb', line 16

def fetch_session(session_token, **opts)
  opts.merge!({use_master_key: false, cache: false})
  headers = {Parse::Protocol::SESSION_TOKEN => session_token}
  response = request :get, "#{SESSION_PATH_PREFIX}/me", headers: headers, opts: opts
  response.parse_class = Parse::Model::CLASS_SESSION
  response
end