File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change 1- import { type Cookies , type Handle , redirect } from "@sveltejs/kit" ;
2- import { resolve } from "$app/paths" ;
31import { env } from "$env/dynamic/private" ;
42import { type Payload , verify } from "$lib/auth" ;
53import { isForced } from "$lib/forced" ;
4+ import { type Cookies , type Handle , redirect } from "@sveltejs/kit" ;
65
76const getAuthCookie = async ( cookies : Cookies ) => {
87 if ( isForced ) {
@@ -29,12 +28,8 @@ const getAuthCookie = async (cookies: Cookies) => {
2928export const handle : Handle = async ( { event, resolve : resolveEvent } ) => {
3029 event . locals . auth = await getAuthCookie ( event . cookies ) ;
3130
32- if (
33- event . url . pathname !== resolve ( "/login" ) &&
34- ! event . locals . auth &&
35- ! isForced
36- ) {
37- return redirect ( 302 , resolve ( "/login" ) ) ;
31+ if ( event . url . pathname !== "/login" && ! event . locals . auth && ! isForced ) {
32+ return redirect ( 302 , "/login" ) ;
3833 }
3934
4035 const start = performance . now ( ) ;
You can’t perform that action at this time.
0 commit comments