From bd3c0fb660c7ec7e7be48bec8d2fc52a4524ba01 Mon Sep 17 00:00:00 2001 From: Rodrigo Gonzalez Date: Wed, 9 Sep 2020 10:59:17 -0300 Subject: [PATCH] Disabled shared secret check and return 500 not 400 on error --- src/WebhooksController.php | 5 +++-- src/exceptions/WebhookFailed.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/WebhooksController.php b/src/WebhooksController.php index 759b33c..d419051 100644 --- a/src/WebhooksController.php +++ b/src/WebhooksController.php @@ -14,9 +14,10 @@ class WebhooksController public function __invoke(Request $request) { $jobConfigKey = NotificationType::{$request->input('notification_type')}(); - $this->determineValidRequest($request->input('password')); - $notificationId = AppleNotification::storeNotification($jobConfigKey, $request->input()); + AppleNotification::storeNotification($jobConfigKey, $request->input()); + + //$this->determineValidRequest($request->input('password')); $payload = NotificationPayload::createFromRequest($request); diff --git a/src/exceptions/WebhookFailed.php b/src/exceptions/WebhookFailed.php index 6f48133..fdc0d7a 100644 --- a/src/exceptions/WebhookFailed.php +++ b/src/exceptions/WebhookFailed.php @@ -8,7 +8,7 @@ class WebhookFailed extends Exception { public static function nonValidRequest() { - return new static("Your shared secret does not match password in Apple's request", 400); + return new static("Your shared secret does not match password in Apple's request", 500); } public static function jobClassDoesNotExist(string $jobClass)