Example #1
0
 private function completeLogin($code)
 {
     $token = $this->rdio->getAccessToken('authorization_code', compact('code'));
     $this->session->del('rdio.state');
     $this->session->set('rdio.token', $token);
     return $this->payload->withStatus(Payload::OK)->withMessages(['redirect' => '/login']);
 }
Example #2
0
 private function callRdio($method, array $body = [])
 {
     $uri = 'https://services.rdio.com/api/1/' . $method;
     $token = $this->session->get('rdio.token');
     $options = ['headers' => ['Accept' => 'application/json', 'Content-Type' => 'application/x-www-form-urlencoded'], 'body' => http_build_query(array_replace($body, compact('method')))];
     $request = $this->rdio->getAuthenticatedRequest('POST', $uri, $token, $options);
     $response = $this->rdio->getResponse($request);
     return $response;
 }