lib/namely/authenticator.rb
def current_user(options)
      access_token = options.fetch(:access_token)
      subdomain = options.fetch(:subdomain)

      user_url = URL.new(options.merge(
        params: {
          access_token: access_token,
        },
        path: "/api/v1/profiles/me",
      )).to_s

      response = RestClient.get(
        user_url,
        accept: :json,
      )
      build_profile(
        access_token,
        subdomain,
        JSON.parse(response)["profiles"].first
      )
    end
def current_user(options)
      access_token = options.fetch(:access_token)
      subdomain = options.fetch(:subdomain)

      user_url = URL.new(options.merge(
        params: {
          access_token: access_token,
        },
        path: "/api/v1/profiles/me",
      )).to_s

      response = RestClient.get(
        user_url,
        accept: :json,
      )
      build_profile(
        access_token,
        subdomain,
        JSON.parse(response)["profiles"].first
      )
    end
def current_user ( options ) access_token = options . fetch ( :access_token ) subdomain = options . fetch ( :subdomain ) user_url = URL . new ( options . merge ( params : { access_token : access_token , } , path : "/api/v1/profiles/me" , ) ) . to_s response = RestClient . get ( user_url , accept : :json , ) build_profile ( access_token , subdomain , JSON . parse ( response ) [ "profiles" ] . first ) end
Return the profile of the user accessing the API.

 @param [Hash] options
 @option options [String] access_token (required)
 @option options [String] subdomain (required)

 @return [Model] the profile of the current user.
Return the profile of the user accessing the API .