1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

auth for webhook request with query-parameter "token"

This commit is contained in:
paulwer 2023-12-28 09:02:51 +01:00
parent 94671fa67e
commit ac69a4f717

View File

@ -61,8 +61,12 @@ class BrevoController extends BaseController
*/
public function webhook(Request $request)
{
ProcessBrevoWebhook::dispatch($request->all())->delay(10);
if ($request->has('token') && $request->get('token') == config('services.brevo.key')) {
ProcessBrevoWebhook::dispatch($request->all())->delay(10);
return response()->json(['message' => 'Success'], 200);
return response()->json(['message' => 'Success'], 200);
}
return response()->json(['message' => 'Unauthorized'], 403);
}
}