Merge pull request #210 from copenhagentruckwash/fix-auth-bypass-in-booking-sync-endpoint

Remove hardcoded auth_key bypass from /admin/bookings/sync
This commit is contained in:
Jeppe B
2026-06-01 23:01:37 +02:00
committed by GitHub
+2 -3
View File
@@ -198,8 +198,7 @@ class bookingsRoute
$this->post('/admin/bookings/sync', function () {
// Require the user to be logged in
global $response;
if ($this->fromRequest('auth_key') !== 'earm8BX4MFTgS6JCNQdqW5EzHUutv2Vx')
$this->requirePermission('sync_bookings');
$this->requirePermission('sync_bookings');
// Check if the request was successful
$booking = [
'id' => $this->fromRequest('id'),
@@ -243,7 +242,7 @@ class bookingsRoute
);
},
[
'sync_bookings' => 'Sync bookings from the external system NOTE: This permission is only required if the auth_key is not set'
'sync_bookings' => 'Sync bookings from the external system'
]
);