Skip to content

Commit bcfa758

Browse files
authored
Merge pull request #650 from code16/support-nonce
Support nonce
2 parents 9138d5d + c58898f commit bcfa758

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

resources/views/app.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<meta http-equiv="X-UA-Compatible" content="IE=edge">
77
<meta name="robots" content="noindex, nofollow" />
88

9-
<script>
9+
<script @if($nonce = \Illuminate\Support\Facades\Vite::cspNonce()) nonce="{{ $nonce }}" @endif>
1010
const preference = localStorage.getItem('vueuse-color-scheme') || 'auto';
1111
if(preference === 'auto' && window.matchMedia('(prefers-color-scheme: dark)').matches || preference === 'dark') {
1212
document.documentElement.classList.add('dark');
@@ -27,7 +27,7 @@
2727
config()->set('ziggy', ['only' => 'code16.sharp.*', 'skip-route-function' => true]);
2828
\Tighten\Ziggy\BladeRouteGenerator::$generated = false; // Don't generate "merge script" (https://github.com/code16/sharp/issues/649)
2929
@endphp
30-
@routes
30+
@routes(nonce: \Illuminate\Support\Facades\Vite::cspNonce())
3131
@inertiaHead
3232

3333
<x-sharp::vite-wrapper>

0 commit comments

Comments
 (0)