Exemple #1
0
 private function addTidalFav($albumId)
 {
     $session = $this->session->get('tidal.session');
     $path = sprintf('users/%d/favorites/albums', $session['userId']);
     $query = ['sessionId' => $session['sessionId'], 'countryCode' => $session['countryCode']];
     $form_params = compact('albumId');
     return $this->tidal->post($path, compact('query', 'form_params'));
 }
Exemple #2
0
 public function __invoke(array $input)
 {
     if (empty($input['code'])) {
         return $this->startLogin();
     }
     if (empty($input['state']) || $input['state'] !== $this->session->get('rdio.state')) {
         return $this->invalidLogin();
     }
     return $this->completeLogin($input['code']);
 }
Exemple #3
0
 public function __invoke(array $input)
 {
     $this->session->del('rdio.token');
     $this->session->del('tidal.session');
     return $this->payload->withStatus(Payload::OK)->withMessages(['redirect' => 'login']);
 }
Exemple #4
0
 public function __invoke(array $input)
 {
     return $this->payload->withStatus(Payload::OK)->withOutput(['rdio_ready' => $this->session->has('rdio.token'), 'tidal_ready' => $this->session->has('tidal.session'), 'template' => 'login']);
 }
Exemple #5
0
 private function completeLogin($username, $password)
 {
     $session = $this->tidal->login($username, $password);
     $this->session->set('tidal.session', $session);
     return $this->payload->withStatus(Payload::OK)->withMessages(['redirect' => '/login']);
 }