File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed
Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change 11import type { LayoutServerLoad } from './$types' ;
2+ import { env } from '$env/dynamic/private' ;
23
3- export const load : LayoutServerLoad = async ( { locals } ) => {
4+ export const load : LayoutServerLoad = async ( { locals, url } ) => {
5+ const origin = env . ORIGIN ?? '' ;
46 return {
7+ originWarning : {
8+ currentOrigin : url . origin ,
9+ isWarning : origin !== url . origin
10+ } ,
511 userAuthenticated : locals . userAuthenticated
612 } ;
713} ;
Original file line number Diff line number Diff line change 11<script lang =" ts" >
22 import { Toaster } from ' svelte-5-french-toast' ;
33 import ' ../app.css' ;
4- let { children } = $props ();
4+ let { children, data } = $props ();
55 </script >
66
77<Toaster />
8+ {#if data .originWarning .isWarning }
9+ <div class =" w-full bg-red-600 p-2 text-center text-white" >
10+ <p >
11+ Invalid origin found. Please specify ORIGIN={data .originWarning .currentOrigin }. Check
12+ <a
13+ target =" _blank"
14+ class =" underline"
15+ href =" https://dashlit.cwec.dev/guide/getting-started.html" >Docs</a
16+ >.
17+ </p >
18+ </div >
19+ {/if }
820{@render children ()}
You can’t perform that action at this time.
0 commit comments