diff --git a/middleware/auth.ts b/middleware/auth.ts
new file mode 100644
index 00000000..8e72eff8
--- /dev/null
+++ b/middleware/auth.ts
@@ -0,0 +1,8 @@
+export default defineNuxtRouteMiddleware((from) => {
+ const token = useCookie('nuxtodon-token')
+
+ if (!token.value)
+ return navigateTo('/public')
+ else if (from.path === '/')
+ return navigateTo('/home')
+})
diff --git a/pages/home.vue b/pages/home.vue
index 7c539dd3..32a96acd 100644
--- a/pages/home.vue
+++ b/pages/home.vue
@@ -1,8 +1,7 @@