Closed matthewknill closed 2 years ago
0.8.0
8.83.5
I am trying to add a nonce via Spatie's CSP Package, however, it doesn't seem to be added to the Ziggy script. I have tried the following to no avail:
@routes(false, csp_nonce()) @routes(null, csp_nonce()) @routes(nonce: csp_nonce()) {{-- actually results in an error --}}
All result in the following without the nonce:
<script type="text/javascript">
// All
// Don't have nonce so can't run
Route::get('login', [AuthenticatedSessionController::class, 'create']) ->name('login') ->middleware('guest'); // And all other routes
Support for passing in a CSP nonce was added in v0.9.3, those examples should all work after you update.
Ah my bad, I was using an outdated version. Cheers
Ziggy version
0.8.0
Laravel version
8.83.5
Description
I am trying to add a nonce via Spatie's CSP Package, however, it doesn't seem to be added to the Ziggy script. I have tried the following to no avail:
All result in the following without the nonce:
Ziggy call and context
Ziggy configuration
Route definition