Migrate SvelteKit to the latest version 431 (#526)

This commit is contained in:
Alex
2022-08-24 21:10:48 -07:00
committed by GitHub
parent fb0fa742f5
commit db2ed2d881
47 changed files with 1509 additions and 1216 deletions

View File

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