diff options
Diffstat (limited to 'src/Controllers/SyncController.php')
-rwxr-xr-x | src/Controllers/SyncController.php | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/Controllers/SyncController.php b/src/Controllers/SyncController.php new file mode 100755 index 0000000..19da1b5 --- /dev/null +++ b/src/Controllers/SyncController.php @@ -0,0 +1,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" => "", + ]); + } +} |