--- /dev/null
+import { redirect } from '@sveltejs/kit';
+
+// Catch-all for unknown routes: redirect to /write (primary app surface)
+// If /write itself handles auth, unauthenticated users will still be bounced to /login there.
+// Adjust here if you later want a different fallback (e.g. redirect to /login when not authenticated).
+export function load() {
+ throw redirect(307, '/write');
+}
import {redirect} from '@sveltejs/kit'
export const load = () => {
- const user = JSON.parse(localStorage.getItem('user'));
+ const user = localStorage.getItem('user');
if (user) {
throw redirect(307, '/write');
}