fixed nonce
This commit is contained in:
parent
96d1bd121e
commit
ff0c090850
3 changed files with 6 additions and 24 deletions
|
|
@ -5,6 +5,7 @@ namespace App\Providers;
|
||||||
use App\Models\Interfaces\MovieDbInterface;
|
use App\Models\Interfaces\MovieDbInterface;
|
||||||
use App\Services\OmdbService;
|
use App\Services\OmdbService;
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
use Livewire\Livewire;
|
||||||
|
|
||||||
class AppServiceProvider extends ServiceProvider
|
class AppServiceProvider extends ServiceProvider
|
||||||
{
|
{
|
||||||
|
|
@ -24,5 +25,10 @@ class AppServiceProvider extends ServiceProvider
|
||||||
if ($this->app->environment('production')) {
|
if ($this->app->environment('production')) {
|
||||||
\URL::forceScheme('https');
|
\URL::forceScheme('https');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Configure Livewire CSP nonce
|
||||||
|
Livewire::setScriptNonce(function () {
|
||||||
|
return request()->attributes->get('csp-nonce');
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Support;
|
|
||||||
|
|
||||||
class LivewireNonce
|
|
||||||
{
|
|
||||||
public function __invoke()
|
|
||||||
{
|
|
||||||
return request()->attributes->get('csp-nonce');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -170,17 +170,4 @@ return [
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'pagination_theme' => 'tailwind',
|
'pagination_theme' => 'tailwind',
|
||||||
|
|
||||||
/*
|
|
||||||
|---------------------------------------------------------------------------
|
|
||||||
| Content Security Policy Nonce
|
|
||||||
|---------------------------------------------------------------------------
|
|
||||||
|
|
|
||||||
| When using Content-Security-Policy headers, Livewire can automatically
|
|
||||||
| apply nonces to its injected scripts. Provide a closure that returns
|
|
||||||
| the nonce value for the current request, or null to disable.
|
|
||||||
|
|
|
||||||
*/
|
|
||||||
|
|
||||||
'nonce' => \App\Support\LivewireNonce::class.'@__invoke',
|
|
||||||
];
|
];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue