mirror of
https://github.com/immich-app/immich.git
synced 2024-11-16 10:28:54 -07:00
feat(web): redirect to login from getting started (#1755)
This commit is contained in:
parent
0f00f22212
commit
1361f18964
@ -15,7 +15,7 @@
|
||||
</h1>
|
||||
<button
|
||||
class="border px-4 py-4 rounded-md bg-immich-primary dark:bg-immich-dark-primary dark:text-immich-dark-gray dark:border-immich-dark-gray hover:bg-immich-primary/75 text-white font-bold w-[200px]"
|
||||
on:click={() => goto('/auth/login')}
|
||||
on:click={() => goto('/auth/register')}
|
||||
>Getting Started
|
||||
</button>
|
||||
</div>
|
||||
|
@ -1,4 +1,5 @@
|
||||
export const prerender = false;
|
||||
import { serverApi } from '@api';
|
||||
import { redirect } from '@sveltejs/kit';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
@ -8,6 +9,12 @@ export const load: PageLoad = async ({ parent }) => {
|
||||
throw redirect(302, '/photos');
|
||||
}
|
||||
|
||||
const { data } = await serverApi.userApi.getUserCount(true);
|
||||
if (data.userCount > 0) {
|
||||
// Redirect to login page if an admin is already registered.
|
||||
throw redirect(302, '/auth/login');
|
||||
}
|
||||
|
||||
return {
|
||||
meta: {
|
||||
title: 'Welcome 🎉',
|
||||
|
Loading…
Reference in New Issue
Block a user