Skip to content

Commit 19b9ade

Browse files
author
Bartosz Butrym
committed
fix: exclude static assets from auth middleware
1 parent 2e6358c commit 19b9ade

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/middleware/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ function isPublicPath(pathname: string): boolean {
2727
return true;
2828
}
2929

30+
// Allow static assets (CSS, JS, images, fonts)
31+
if (pathname.startsWith('/_astro/') || pathname.startsWith('/favicon.')) {
32+
return true;
33+
}
34+
3035
// Allow API routes except auth-protected ones
3136
if (pathname.startsWith('/api/') && !pathname.startsWith('/api/profiles') && !pathname.startsWith('/api/quests')) {
3237
return true;

0 commit comments

Comments
 (0)