Fix: sjekk hostname direkte i layout.server.ts for isAdminHost
event.locals.isAdminHost fra hooks ble ikke pålitelig overført. Sjekker event.url.hostname direkte i stedet. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
8885a13d9b
commit
8981fc3ea5
1 changed files with 2 additions and 1 deletions
|
|
@ -1,8 +1,9 @@
|
||||||
import type { LayoutServerLoad } from './$types';
|
import type { LayoutServerLoad } from './$types';
|
||||||
|
|
||||||
export const load: LayoutServerLoad = async (event) => {
|
export const load: LayoutServerLoad = async (event) => {
|
||||||
|
const host = event.url.hostname;
|
||||||
return {
|
return {
|
||||||
session: await event.locals.auth(),
|
session: await event.locals.auth(),
|
||||||
isAdminHost: (event.locals as Record<string, unknown>).isAdminHost === true,
|
isAdminHost: host === 'adm.synops.no',
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue