BLOG-136 Dashboard route and frontend authentication #137

Merged
squid merged 10 commits from BLOG-136_create_dashboard_route into main 2025-10-13 20:33:36 +08:00
2 changed files with 11 additions and 10 deletions
Showing only changes of commit 7f03cfa3c9 - Show all commits

View File

@ -1,10 +0,0 @@
import { redirect } from '@sveltejs/kit';
import type { PageServerLoad } from './$types';
export const load: PageServerLoad = async ({ url }) => {
const { pathname } = url;
if (pathname === '/dashboard') {
redirect(302, '/dashboard/post');
}
};

View File

@ -0,0 +1,11 @@
<script lang="ts">
import { goto } from '$app/navigation';
import { page } from '$app/state';
import { onMount } from 'svelte';
onMount(() => {
if (page.url.pathname === '/dashboard') {
goto('/dashboard/post');
}
});
</script>