Files
immich/web/src/routes/auth/register/+page.server.ts
T
2023-02-22 20:49:13 -06:00

18 lines
407 B
TypeScript

import { redirect } from '@sveltejs/kit';
import type { PageServerLoad } from './$types';
import { api } from '@api';
export const load: PageServerLoad = async () => {
const { data } = await api.userApi.getUserCount(true);
if (data.userCount != 0) {
// Admin has been registered, redirect to login
throw redirect(302, '/auth/login');
}
return {
meta: {
title: 'Admin Registration'
}
};
};