From 74e5f76ec2005dbf6c4baac6095ad2d4c48abbaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reinhard=20X=2E=20F=C3=BCrst?= Date: Wed, 4 Mar 2026 13:20:50 +0000 Subject: [PATCH] V 1.2.0 migration.tsx in proxy.tsx umbenannt Loginpage eingebettet --- app/login/page.tsx | 128 ++++++++++++++++++++------------------ package.json | 2 +- middleware.ts => proxy.ts | 6 +- 3 files changed, 71 insertions(+), 65 deletions(-) rename middleware.ts => proxy.ts (94%) diff --git a/app/login/page.tsx b/app/login/page.tsx index b673ff0..adbc23e 100644 --- a/app/login/page.tsx +++ b/app/login/page.tsx @@ -7,73 +7,77 @@ export default function LoginPage() { const [state, loginAction, isPending] = useActionState(login, undefined); return ( -
-
-
-

- Anmeldung -

-

- Bitte melden Sie sich an, um fortzufahren -

-
+
+
+

Ausgaben - Log

-
-
-
- - +
+
+
+

Anmeldung

+

+ Bitte melden Sie sich an, um fortzufahren +

-
- - +
+
+ + +
+ +
+ + +
+
+ + {state?.error && ( +
+ {state.error} +
+ )} + +
+ className="w-full flex justify-center py-3 px-4 border border-transparent text-sm font-semibold rounded-lg text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:opacity-50 disabled:cursor-not-allowed transition-all duration-200 shadow-lg hover:shadow-xl" + > + {isPending ? 'Anmeldung läuft...' : 'Anmelden'} + +
- - {state?.error && ( -
- {state.error} -
- )} - - - -
+
+
); } diff --git a/package.json b/package.json index a197adc..e859099 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ausgaben_next", - "version": "1.1.0", + "version": "1.2.0", "private": true, "scripts": { "dev": "next dev -p 3005", diff --git a/middleware.ts b/proxy.ts similarity index 94% rename from middleware.ts rename to proxy.ts index 68d704d..6ce7c61 100644 --- a/middleware.ts +++ b/proxy.ts @@ -4,10 +4,10 @@ import { jwtVerify } from 'jose'; const SESSION_COOKIE_NAME = 'auth_session'; /** - * Middleware to protect routes with authentication + * Proxy to protect routes with authentication * Reusable for other projects - just copy this file */ -export async function middleware(request: NextRequest) { +export async function proxy(request: NextRequest) { const { pathname } = request.nextUrl; // Check if authentication is enabled @@ -58,6 +58,8 @@ export async function middleware(request: NextRequest) { } } +export default proxy; + export const config = { matcher: [ /*