Fix: fjern ORIGIN for multi-subdomain host-deteksjon
ORIGIN=https://ws.synops.no tvang SvelteKit til å sette url.hostname til ws.synops.no for ALLE requests. Fjernet ORIGIN — AUTH_TRUST_HOST=true lar SvelteKit lese hostname fra Host-headeren, som gir korrekt adm.synops.no-deteksjon. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
8981fc3ea5
commit
f239ada4f6
1 changed files with 5 additions and 1 deletions
|
|
@ -2,8 +2,12 @@ import type { LayoutServerLoad } from './$types';
|
||||||
|
|
||||||
export const load: LayoutServerLoad = async (event) => {
|
export const load: LayoutServerLoad = async (event) => {
|
||||||
const host = event.url.hostname;
|
const host = event.url.hostname;
|
||||||
|
const isAdmin = host === 'adm.synops.no';
|
||||||
|
if (isAdmin) {
|
||||||
|
console.log('[layout] adm.synops.no detected, host=' + host);
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
session: await event.locals.auth(),
|
session: await event.locals.auth(),
|
||||||
isAdminHost: host === 'adm.synops.no',
|
isAdminHost: isAdmin,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue