mv login page to root page

This commit is contained in:
2025-07-31 23:30:14 +02:00
parent 0812a6b2cb
commit da288f20cd
2 changed files with 34 additions and 18 deletions
+29 -12
View File
@@ -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 (
<main
className={`flex min-h-screen flex-col items-center justify-between p-24`}
>
<main className="flex min-h-screen flex-col items-center justify-between p-24">
<div>
<h1
className={`${nunito.className} text-outline text-[42px] tracking-tighter text-yellow-500`}
>
Herzlich Willkommen bei Muzak!
LOGIN
</h1>
{auth.isAuthenticated && <></>}
{!auth.isAuthenticated && (
<h2
className={`${nunito.className} text-outline text-[32px] tracking-tighter text-yellow-500`}
>
Bitte authentificeren.
</h2>
)}
</div>
{auth.isAuthenticated && (
<h2
className={`${nunito.className} text-outline mb-16 text-[32px] tracking-tighter text-yellow-500`}
>
Hallo je bent nu ingelogd.
</h2>
)}
{!auth.isAuthenticated && (
<div className="mb-15 flex flex-col items-center justify-between gap-4 rounded-md bg-blue-950/80 p-8">
<p className="text-2xl font-semibold text-white drop-shadow-sm drop-shadow-gray-900">
Welkom, {userName}!
</p>
<button
className="w-full rounded bg-blue-500 px-4 py-2 text-center font-bold text-white hover:bg-blue-400"
onClick={() => void auth.signinRedirect()}
>
<Link href="/nominations" className="w-full">
Inloggen
</Link>
</button>
</div>
)}
<div></div>
</main>
);
}