File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import type { LayoutServerLoad } from './$types' ;
22import { env } from '$env/dynamic/private' ;
33
4- export const load : LayoutServerLoad = async ( { locals, url } ) => {
5- const origin = env . ORIGIN ?? '' ;
4+ export const load : LayoutServerLoad = async ( { locals } ) => {
65 return {
7- originWarning : {
8- currentOrigin : url . origin ,
9- isWarning : origin !== url . origin
10- } ,
6+ envOrigin : env . ORIGIN ?? '' ,
117 userAuthenticated : locals . userAuthenticated
128 } ;
139} ;
Original file line number Diff line number Diff line change 11<script lang =" ts" >
22 import { Toaster } from ' svelte-5-french-toast' ;
3+ import { page } from ' $app/state' ;
34 import ' ../app.css' ;
45 let { children, data } = $props ();
56 </script >
67
78<Toaster />
8- {#if data .originWarning . isWarning }
9+ {#if data .envOrigin !== page . url . origin }
910 <div class =" w-full bg-red-600 p-2 text-center text-white" >
1011 <p >
11- Invalid origin found. Please specify ORIGIN={data . originWarning . currentOrigin }. Check
12+ Invalid ORIGIN found. Please specify ORIGIN={page . url . origin }. Check the
1213 <a
1314 target =" _blank"
1415 class =" underline"
You can’t perform that action at this time.
0 commit comments