File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 11import { FRACTAL_SERVER_HOST } from '$env/static/private'
22import { whoami } from '$lib/server/api/v1/auth_api'
33
4- export async function load ( { fetch } ) {
4+ export async function load ( { fetch, cookies } ) {
55 // This is a mark to notify and log when the server is running SSR
66 console . log ( 'SSR - Main layout' )
77
@@ -16,6 +16,17 @@ export async function load({ fetch }) {
1616 console . error ( error )
1717 } )
1818
19+ // Check user info
20+ // Check auth cookie is present
21+ const fastApiUsersAuth = cookies . get ( 'fastapiusersauth' )
22+ if ( ! fastApiUsersAuth ) {
23+ console . log ( 'No auth cookie found' )
24+ return {
25+ serverInfo,
26+ userInfo : null
27+ }
28+ }
29+
1930 const userInfo = await whoami ( fetch )
2031 . catch ( error => {
2132 console . log ( 'Error loading user info' )
You can’t perform that action at this time.
0 commit comments