Files
Musify/web-player/src/routes/+layout.server.ts
T
Admin 546aef6d83 refactor: rename frontend/ to web-player/ and format with prettier
Updates the compose build context, the Dockerfile header, the package
name and the docs. The compose service and container keep the name
frontend/musify-frontend, since nginx routes to http://frontend:3000.

The source files also carry the first prettier pass, so the rename and
the reformat land together for them.
2026-07-20 07:35:01 +02:00

12 lines
375 B
TypeScript

import { redirect } from '@sveltejs/kit';
import type { LayoutServerLoad } from './$types';
const PUBLIC_PATHS = new Set(['/login']);
export const load: LayoutServerLoad = ({ locals, url }) => {
if (!locals.user && !PUBLIC_PATHS.has(url.pathname)) {
redirect(302, `/login?returnTo=${encodeURIComponent(url.pathname + url.search)}`);
}
return { user: locals.user };
};