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"} ) : ( <> -
)}