From 9fefd0d8c40d9b38543e11670fd669545045561f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Duli=C3=A7i?= Date: Wed, 21 Apr 2021 09:59:56 +0300 Subject: [PATCH] allow users to see signed pages --- app/Abstracts/Http/PaymentController.php | 6 +-- app/Http/Kernel.php | 2 - .../RedirectSignedIfAuthenticated.php | 37 ------------------- 3 files changed, 3 insertions(+), 42 deletions(-) delete mode 100644 app/Http/Middleware/RedirectSignedIfAuthenticated.php diff --git a/app/Abstracts/Http/PaymentController.php b/app/Abstracts/Http/PaymentController.php index c22045b39..157429b49 100644 --- a/app/Abstracts/Http/PaymentController.php +++ b/app/Abstracts/Http/PaymentController.php @@ -117,9 +117,9 @@ abstract class PaymentController extends BaseController public function getInvoiceUrl($invoice) { - return $this->user + return request()->isPortal($invoice->company_id) ? route('portal.invoices.show', $invoice->id) - : URL::signedRoute('signed.invoices.show', [$invoice->id, 'company_id' => $invoice->company_id]); + : URL::signedRoute('signed.invoices.show', [$invoice->id]); } public function getConfirmUrl($invoice) @@ -144,7 +144,7 @@ abstract class PaymentController extends BaseController public function getModuleUrl($invoice, $suffix) { - return $this->user + return request()->isPortal($invoice->company_id) ? route('portal.' . $this->alias . '.invoices.' . $suffix, $invoice->id) : URL::signedRoute('signed.' . $this->alias . '.invoices.' . $suffix, [$invoice->id]); } diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index 95a62f472..7d46349f9 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -107,7 +107,6 @@ class Kernel extends HttpKernel 'session.errors', 'csrf', 'signature', - 'signed.redirect', 'company.identify', 'bindings', 'header.x', @@ -154,7 +153,6 @@ class Kernel extends HttpKernel 'install.can' => \App\Http\Middleware\CanInstall::class, 'install.redirect' => \App\Http\Middleware\RedirectIfNotInstalled::class, 'money' => \App\Http\Middleware\Money::class, - 'signed.redirect' => \App\Http\Middleware\RedirectSignedIfAuthenticated::class, 'wizard.redirect' => \App\Http\Middleware\RedirectIfWizardNotCompleted::class, // Vendor diff --git a/app/Http/Middleware/RedirectSignedIfAuthenticated.php b/app/Http/Middleware/RedirectSignedIfAuthenticated.php deleted file mode 100644 index 841c879cf..000000000 --- a/app/Http/Middleware/RedirectSignedIfAuthenticated.php +++ /dev/null @@ -1,37 +0,0 @@ -contact ? 'portal.' : ''; - $page = 'dashboard'; - $params = []; - - if ($request->segment(3) == 'invoices') { - $page = 'invoices.show'; - - $invoice = Document::find($request->segment(4)); - - $params = [$invoice->id]; - } - - return redirect()->route($prefix . $page, $params); - } -}