From da288f20cdef2b03db2c0a62c9e2b79456266ac9 Mon Sep 17 00:00:00 2001 From: Guus Date: Thu, 31 Jul 2025 23:30:14 +0200 Subject: [PATCH] mv login page to root page --- frontend/src/app/page.tsx | 41 ++++++++++++++++++-------- frontend/src/components/AuthStatus.tsx | 11 ++++--- 2 files changed, 34 insertions(+), 18 deletions(-) diff --git a/frontend/src/app/page.tsx b/frontend/src/app/page.tsx index 0348607..f7aac18 100644 --- a/frontend/src/app/page.tsx +++ b/frontend/src/app/page.tsx @@ -5,6 +5,7 @@ import Link from "next/link"; import { Log } from "oidc-client-ts"; import { useAuth } from "react-oidc-context"; import { Nunito } from "next/font/google"; +import { use, useState } from "react"; Log.setLogger(console); const nunito = Nunito({ @@ -13,28 +14,44 @@ const nunito = Nunito({ }); export default function Page() { + const [userName, setUserName] = useState("Stroop"); const auth = useAuth(); console.log(auth); return ( -
+

- Herzlich Willkommen bei Muzak! + LOGIN

- {auth.isAuthenticated && <>} - {!auth.isAuthenticated && ( -

- Bitte authentificeren. -

- )}
+ {auth.isAuthenticated && ( +

+ Hallo je bent nu ingelogd. +

+ )} + {!auth.isAuthenticated && ( +
+

+ Welkom, {userName}! +

+ + +
+ )} + +
); } diff --git a/frontend/src/components/AuthStatus.tsx b/frontend/src/components/AuthStatus.tsx index cd3655f..6335712 100644 --- a/frontend/src/components/AuthStatus.tsx +++ b/frontend/src/components/AuthStatus.tsx @@ -49,12 +49,12 @@ export default function AuthStatus() { return (
{displayState.isAuthenticated ? ( <>
- + {displayState.user?.profile.name || "Authenticated"} ) : ( <> -
)}