summaryrefslogtreecommitdiff
path: root/src/Controllers/SyncController.php
diff options
context:
space:
mode:
authorDaniel Weipert <git@mail.dweipert.de>2025-08-15 15:47:27 +0200
committerDaniel Weipert <git@mail.dweipert.de>2025-08-15 15:47:27 +0200
commita0ad1f5e7fac279b33ea09ca0e347cd7d02cd8ec (patch)
tree15363be13084bd61b386cf817212096089ea508f /src/Controllers/SyncController.php
parentc135fcf9041c604b32827a1cb027010bca5915ab (diff)
keys and sync endpoint setup
Diffstat (limited to 'src/Controllers/SyncController.php')
-rwxr-xr-xsrc/Controllers/SyncController.php26
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" => "",
+ ]);
+ }
+}