Files
next-portfolio/src/components/auth/login.tsx

19 lines
424 B
TypeScript

import { auth } from "@/lib/auth";
import { LoginButton } from "./login_button";
import { LogoutButton } from "./logout_button";
/**
* This is a server component, then the buttons are client side
*/
export default async function LogIn(): Promise<JSX.Element | undefined> {
const session = await auth();
if (session) {
return (
<LogoutButton/>
);
} else {
return (
<LoginButton/>
);
}
}