[FA-misc] Refresh button, UI mostly gold
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { defineMiddleware } from 'astro:middleware';
|
||||
|
||||
const STATIC_PATHS = ['/_astro/', '/favicon.svg', '/favicon.ico'];
|
||||
const AUTH_BYPASS_PATHS = ['/gated-404'];
|
||||
|
||||
export const onRequest = defineMiddleware(async (context, next) => {
|
||||
const { request, url } = context;
|
||||
@@ -10,6 +11,11 @@ export const onRequest = defineMiddleware(async (context, next) => {
|
||||
return next();
|
||||
}
|
||||
|
||||
// Bypass auth for gated pages to prevent redirect loops
|
||||
if (AUTH_BYPASS_PATHS.includes(url.pathname)) {
|
||||
return next();
|
||||
}
|
||||
|
||||
// Simple presence check for fa_session cookie
|
||||
const cookieHeader = request.headers.get('cookie') || '';
|
||||
const hasSession = /fa_session=[^;]+/.test(cookieHeader);
|
||||
|
||||
Reference in New Issue
Block a user