allow users to see signed pages
This commit is contained in:
parent
71c63b28db
commit
9fefd0d8c4
@ -117,9 +117,9 @@ abstract class PaymentController extends BaseController
|
|||||||
|
|
||||||
public function getInvoiceUrl($invoice)
|
public function getInvoiceUrl($invoice)
|
||||||
{
|
{
|
||||||
return $this->user
|
return request()->isPortal($invoice->company_id)
|
||||||
? route('portal.invoices.show', $invoice->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)
|
public function getConfirmUrl($invoice)
|
||||||
@ -144,7 +144,7 @@ abstract class PaymentController extends BaseController
|
|||||||
|
|
||||||
public function getModuleUrl($invoice, $suffix)
|
public function getModuleUrl($invoice, $suffix)
|
||||||
{
|
{
|
||||||
return $this->user
|
return request()->isPortal($invoice->company_id)
|
||||||
? route('portal.' . $this->alias . '.invoices.' . $suffix, $invoice->id)
|
? route('portal.' . $this->alias . '.invoices.' . $suffix, $invoice->id)
|
||||||
: URL::signedRoute('signed.' . $this->alias . '.invoices.' . $suffix, [$invoice->id]);
|
: URL::signedRoute('signed.' . $this->alias . '.invoices.' . $suffix, [$invoice->id]);
|
||||||
}
|
}
|
||||||
|
@ -107,7 +107,6 @@ class Kernel extends HttpKernel
|
|||||||
'session.errors',
|
'session.errors',
|
||||||
'csrf',
|
'csrf',
|
||||||
'signature',
|
'signature',
|
||||||
'signed.redirect',
|
|
||||||
'company.identify',
|
'company.identify',
|
||||||
'bindings',
|
'bindings',
|
||||||
'header.x',
|
'header.x',
|
||||||
@ -154,7 +153,6 @@ class Kernel extends HttpKernel
|
|||||||
'install.can' => \App\Http\Middleware\CanInstall::class,
|
'install.can' => \App\Http\Middleware\CanInstall::class,
|
||||||
'install.redirect' => \App\Http\Middleware\RedirectIfNotInstalled::class,
|
'install.redirect' => \App\Http\Middleware\RedirectIfNotInstalled::class,
|
||||||
'money' => \App\Http\Middleware\Money::class,
|
'money' => \App\Http\Middleware\Money::class,
|
||||||
'signed.redirect' => \App\Http\Middleware\RedirectSignedIfAuthenticated::class,
|
|
||||||
'wizard.redirect' => \App\Http\Middleware\RedirectIfWizardNotCompleted::class,
|
'wizard.redirect' => \App\Http\Middleware\RedirectIfWizardNotCompleted::class,
|
||||||
|
|
||||||
// Vendor
|
// Vendor
|
||||||
|
@ -1,37 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Http\Middleware;
|
|
||||||
|
|
||||||
use App\Models\Document\Document;
|
|
||||||
use Closure;
|
|
||||||
|
|
||||||
class RedirectSignedIfAuthenticated
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Handle an incoming request.
|
|
||||||
*
|
|
||||||
* @param \Illuminate\Http\Request $request
|
|
||||||
* @param \Closure $next
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
public function handle($request, Closure $next)
|
|
||||||
{
|
|
||||||
if (!$user = user()) {
|
|
||||||
return $next($request);
|
|
||||||
}
|
|
||||||
|
|
||||||
$prefix = $user->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);
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user