Skip to content

Commit a9aaa45

Browse files
committed
fix(ui): check pathname for now
1 parent ca9fdc3 commit a9aaa45

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

ui/src/hooks.server.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import { type Cookies, type Handle, redirect } from "@sveltejs/kit";
2-
import { resolve } from "$app/paths";
31
import { env } from "$env/dynamic/private";
42
import { type Payload, verify } from "$lib/auth";
53
import { isForced } from "$lib/forced";
4+
import { type Cookies, type Handle, redirect } from "@sveltejs/kit";
65

76
const getAuthCookie = async (cookies: Cookies) => {
87
if (isForced) {
@@ -29,12 +28,8 @@ const getAuthCookie = async (cookies: Cookies) => {
2928
export 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();

0 commit comments

Comments
 (0)