summaryrefslogtreecommitdiff
path: root/src/Controllers/SyncController.php
blob: 19da1b5c7723f16ed8c7d476c7dfb8f81846fa8d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php

namespace App\Controllers;

use App\Errors\UnauthorizedError;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\JsonResponse;

class SyncController
{
  public function sync(): Response
  {
    $request = Request::createFromGlobals();

    if ($request->headers->get("authorization") != "Bearer abc123") {
      # TODO: get user based on bearer token
      throw new UnauthorizedError();
    }

    return new JsonResponse([
      "account_data" => [],
      "next_batch" => "",
    ]);
  }
}