close #700 Fixed: Signed url not working
This commit is contained in:
@@ -222,12 +222,12 @@ class Invoices extends Controller
|
||||
$codes = explode('.', $payment_method_key);
|
||||
|
||||
if (!isset($payment_actions[$codes[0]])) {
|
||||
$payment_actions[$codes[0]] = SignedUrl::sign(url('links/invoices/' . $invoice->id . '/' . $codes[0]), 1);
|
||||
$payment_actions[$codes[0]] = SignedUrl::sign(url('signed/invoices/' . $invoice->id . '/' . $codes[0]), 1);
|
||||
}
|
||||
}
|
||||
|
||||
$print_action = SignedUrl::sign(url('links/invoices/' . $invoice->id . '/print'), 1);
|
||||
$pdf_action = SignedUrl::sign(url('links/invoices/' . $invoice->id . '/pdf'), 1);
|
||||
$print_action = SignedUrl::sign(route('signed.invoices.print', $invoice->id), 1);
|
||||
$pdf_action = SignedUrl::sign(route('signed.invoices.pdf', $invoice->id), 1);
|
||||
|
||||
return view('customers.invoices.link', compact('invoice', 'accounts', 'currencies', 'account_currency_code', 'customers', 'categories', 'payment_methods', 'payment_actions', 'print_action', 'pdf_action'));
|
||||
}
|
||||
|
@@ -85,7 +85,7 @@ class Invoices extends Controller
|
||||
|
||||
$payment_methods = Modules::getPaymentMethods();
|
||||
|
||||
$customer_share = SignedUrl::sign(url('links/invoices/' . $invoice->id));
|
||||
$customer_share = SignedUrl::sign(route('signed.invoices', $invoice->id));
|
||||
|
||||
return view('incomes.invoices.show', compact('invoice', 'accounts', 'currencies', 'account_currency_code', 'customers', 'categories', 'payment_methods', 'customer_share'));
|
||||
}
|
||||
|
@@ -75,8 +75,18 @@ class Kernel extends HttpKernel
|
||||
],
|
||||
|
||||
'signed' => [
|
||||
\App\Http\Middleware\EncryptCookies::class,
|
||||
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
|
||||
\Illuminate\Session\Middleware\StartSession::class,
|
||||
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
|
||||
\App\Http\Middleware\VerifyCsrfToken::class,
|
||||
'signed-url',
|
||||
'signed-url.company',
|
||||
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
||||
\App\Http\Middleware\RedirectIfNotInstalled::class,
|
||||
\App\Http\Middleware\AddXHeader::class,
|
||||
'company.settings',
|
||||
'company.currencies',
|
||||
]
|
||||
];
|
||||
|
||||
|
@@ -39,6 +39,8 @@ class RouteServiceProvider extends ServiceProvider
|
||||
|
||||
$this->mapWebRoutes();
|
||||
|
||||
$this->mapSignedRoutes();
|
||||
|
||||
//
|
||||
}
|
||||
|
||||
@@ -52,8 +54,23 @@ class RouteServiceProvider extends ServiceProvider
|
||||
protected function mapWebRoutes()
|
||||
{
|
||||
Route::middleware('web')
|
||||
->namespace($this->namespace)
|
||||
->group(base_path('routes/web.php'));
|
||||
->namespace($this->namespace)
|
||||
->group(base_path('routes/web.php'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the "signed" routes for the application.
|
||||
*
|
||||
* These routes all receive session state, CSRF protection, etc.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function mapSignedRoutes()
|
||||
{
|
||||
Route::prefix('signed')
|
||||
->middleware('signed')
|
||||
->namespace($this->namespace)
|
||||
->group(base_path('routes/signed.php'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -66,8 +83,8 @@ class RouteServiceProvider extends ServiceProvider
|
||||
protected function mapApiRoutes()
|
||||
{
|
||||
Route::prefix('api')
|
||||
->middleware('api')
|
||||
->namespace($this->namespace)
|
||||
->group(base_path('routes/api.php'));
|
||||
->middleware('api')
|
||||
->namespace($this->namespace)
|
||||
->group(base_path('routes/api.php'));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user