mirror of
				https://github.com/KevinMidboe/immich.git
				synced 2025-10-29 17:40:28 +00:00 
			
		
		
		
	feat(web): redirect to login from getting started (#1755)
This commit is contained in:
		@@ -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 🎉',
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user