1
0
mirror of https://github.com/immich-app/immich.git synced 2024-11-24 08:52:28 +02:00

feat(web): redirect to login from getting started (#1755)

This commit is contained in:
Michel Heusschen 2023-02-15 13:42:41 +01:00 committed by GitHub
parent 0f00f22212
commit 1361f18964
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -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>

View File

@ -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 🎉',