oauth.php 442 B

12345678910111213
  1. <?php
  2. $app->get('/oauth/trakt', function ($request, $response, $args) {
  3. $Organizr = ($request->getAttribute('Organizr')) ?? new Organizr();
  4. if ($Organizr->checkRoute($request)) {
  5. if ($Organizr->qualifyRequest(1, true)) {
  6. $Organizr->traktOAuth();
  7. }
  8. }
  9. $response->getBody()->write(jsonE($GLOBALS['api']));
  10. return $response
  11. ->withHeader('Content-Type', 'application/json;charset=UTF-8')
  12. ->withStatus($GLOBALS['responseCode']);
  13. });