Files
OnePieceDle/src/routes/(admin)/admin/+layout.server.ts
whidix b849e6c4dc feat: add daily win recording endpoint, user authentication, and profile management
- Implemented a POST endpoint for recording daily wins in the game.
- Created login and signup functionality with email and password.
- Developed a profile page allowing users to update their profile information, change passwords, and manage active sessions.
- Added a toggle feature for switching between login and signup forms.
- Enhanced the layout by removing the profile button and adjusting the header structure.
2026-03-01 23:01:44 +01:00

13 lines
264 B
TypeScript

import { redirect } from '@sveltejs/kit';
import type { LayoutServerLoad } from './$types';
export const load: LayoutServerLoad = async ({ locals }) => {
if (!locals.user) {
redirect(302, '/login');
}
if (!locals.user.isAdmin) {
redirect(302, '/');
}
};