mirror of
https://github.com/BradNut/boredgame
synced 2025-09-08 17:40:22 +00:00
18 lines
472 B
TypeScript
18 lines
472 B
TypeScript
import { notSignedInMessage } from '$lib/flashMessages';
|
|
import { redirect } from 'sveltekit-flash-message/server';
|
|
import type { PageServerLoad } from './$types';
|
|
|
|
export const load: PageServerLoad = async (event) => {
|
|
const { locals } = event;
|
|
|
|
const authedUser = await locals.getAuthedUser();
|
|
if (!authedUser) {
|
|
throw redirect(302, '/login', notSignedInMessage, event);
|
|
}
|
|
|
|
return {
|
|
hasSetupTwoFactor: authedUser.mfa_enabled,
|
|
};
|
|
};
|
|
|
|
export const actions = {};
|