feat(auth): add auth guard in hooks.server.ts with session validation
Validates session cookie via GET /v1/auth/me, populates event.locals with benutzer and haushalt, redirects to /login if unauthenticated. Public routes (/login, /register, /invite) bypass auth. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
25
frontend/src/app.d.ts
vendored
Normal file
25
frontend/src/app.d.ts
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
// See https://svelte.dev/docs/kit/types#app.d.ts
|
||||
// for information about these interfaces
|
||||
declare global {
|
||||
namespace App {
|
||||
interface Error {
|
||||
meldung?: string;
|
||||
}
|
||||
interface Locals {
|
||||
benutzer?: {
|
||||
id: string;
|
||||
name: string;
|
||||
rolle: 'planer' | 'mitglied';
|
||||
};
|
||||
haushalt?: {
|
||||
id: string;
|
||||
name: string;
|
||||
};
|
||||
}
|
||||
// interface PageData {}
|
||||
// interface PageState {}
|
||||
// interface Platform {}
|
||||
}
|
||||
}
|
||||
|
||||
export {};
|
||||
Reference in New Issue
Block a user