diff --git a/src/routes/admin/+layout.server.ts b/src/routes/admin/+layout.server.ts
new file mode 100644
index 0000000..8537ad8
--- /dev/null
+++ b/src/routes/admin/+layout.server.ts
@@ -0,0 +1,16 @@
+import { redirect } from "@sveltejs/kit";
+import type { LayoutServerLoad } from "./$types.js";
+import { CookieAuthentication } from "$lib/blog/auth/CookieAuthentication.js";
+
+export const load: LayoutServerLoad = ({ cookies, route }) => {
+ const auth = new CookieAuthentication(cookies)
+ const isAuthd = auth.isAuthdAsAdmin
+
+ if (route.id === '/admin/login' && isAuthd) {
+ return redirect(307, '/admin')
+ } else if (!isAuthd && route.id !== '/admin/login') {
+ return redirect(307, '/admin/login')
+ }
+
+ return {}
+}
diff --git a/src/routes/admin/+page.svelte b/src/routes/admin/+page.svelte
new file mode 100644
index 0000000..df26030
--- /dev/null
+++ b/src/routes/admin/+page.svelte
@@ -0,0 +1 @@
+
Welcome home, Wilson
diff --git a/src/routes/admin/login/+page.server.ts b/src/routes/admin/login/+page.server.ts
new file mode 100644
index 0000000..22116a0
--- /dev/null
+++ b/src/routes/admin/login/+page.server.ts
@@ -0,0 +1,25 @@
+import { PRIVATE_ADMIN_AUTH_TOKEN } from "$env/static/private";
+import { redirect } from "@sveltejs/kit";
+import type { Actions} from "./$types.js";
+import { CookieAuthentication } from "$lib/blog/auth/CookieAuthentication.js";
+
+export const actions = {
+ default: async ({cookies, request}) => {
+ const formData = await request.formData()
+ const token = formData.get('token')
+
+ const isAuthd = PRIVATE_ADMIN_AUTH_TOKEN === token;
+ const auth = new CookieAuthentication(cookies)
+
+ auth.setAdminAuthentication(isAuthd)
+
+ if (isAuthd) {
+ return redirect(307, '/admin')
+ }
+
+ return {
+ isAuthd
+ }
+ }
+
+} satisfies Actions
diff --git a/src/routes/admin/login/+page.svelte b/src/routes/admin/login/+page.svelte
new file mode 100644
index 0000000..18ff60c
--- /dev/null
+++ b/src/routes/admin/login/+page.svelte
@@ -0,0 +1,11 @@
+Admin login
+
+