Finished Moodle oAuth service

READ Moodle section in README file
This commit is contained in:
PxlLoewe
2025-02-27 00:32:44 +01:00
parent b81bab1dc2
commit 9366f8f6b4
8 changed files with 149 additions and 50 deletions

View File

@@ -1,23 +1,22 @@
'use client';
"use client";
import { useSession } from 'next-auth/react';
import Link from 'next/link';
import { useSession } from "next-auth/react";
import Link from "next/link";
export const Header = () => {
const session = useSession();
console.log(session);
return (
<header className="flex justify-between items-center p-4">
<h1 className="text-2xl font-bold">Hub</h1>
<div>
{session.status === 'authenticated' ? (
<p>{session.data?.user.firstname}</p>
) : (
<Link href="/login">
<button className="btn">Login</button>
</Link>
)}
</div>
</header>
);
const session = useSession();
return (
<header className="flex justify-between items-center p-4">
<h1 className="text-2xl font-bold">Hub</h1>
<div>
{session.status === "authenticated" ? (
<p>{session.data?.user.firstname}</p>
) : (
<Link href="/login">
<button className="btn">Login</button>
</Link>
)}
</div>
</header>
);
};