File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -7,14 +7,13 @@ export async function handle({ event, resolve }) {
77 }
88
99 // Authentication guard
10- if ( event . cookies ) {
11- // const token = cookie
12- const whoami = await event . fetch ( `${ FRACTAL_SERVER_HOST } /auth/whoami` )
13- if ( whoami . ok ) {
14- return await resolve ( event )
15- } else {
16- return new Response ( null , { status : 302 , headers : { location : '/auth/login' } } )
17- }
10+ const fastApiUsersAuth = event . cookies . get ( 'fastapiusersauth' )
11+ if ( ! fastApiUsersAuth ) {
12+ return new Response ( null , { status : 302 , headers : { location : '/auth/login' } } )
13+ }
14+ const whoami = await event . fetch ( `${ FRACTAL_SERVER_HOST } /auth/whoami` )
15+ if ( whoami . ok ) {
16+ return await resolve ( event )
1817 } else {
1918 return new Response ( null , { status : 302 , headers : { location : '/auth/login' } } )
2019 }
You can’t perform that action at this time.
0 commit comments