fix: Svelte 5 test event delegation + login auth regression #46

Merged
marcel merged 2 commits from fix/svelte5-test-delegation-and-login-auth into main 2026-03-22 14:56:14 +01:00
Showing only changes of commit 9731afb776 - Show all commits

View File

@@ -65,6 +65,12 @@ export const handleFetch: HandleFetch = async ({ event, request, fetch }) => {
const isApi = request.url.startsWith(apiUrl) || request.url.includes('/api/');
if (isApi) {
// If the request already carries an explicit Authorization header (e.g. the
// login action sends Basic auth), pass it through unchanged.
if (request.headers.has('Authorization')) {
return fetch(request);
}
const token = event.cookies.get('auth_token');
if (!token) {