BLOG-136 Dashboard route and frontend authentication #137
@ -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');
|
||||
}
|
||||
};
|
@ -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>
|
Loading…
x
Reference in New Issue
Block a user