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')); }
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']); }
public function __invoke(array $input) { $this->session->del('rdio.token'); $this->session->del('tidal.session'); return $this->payload->withStatus(Payload::OK)->withMessages(['redirect' => 'login']); }
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']); }
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']); }