Firist commit
This commit is contained in:
19
src/components/auth/login.tsx
Normal file
19
src/components/auth/login.tsx
Normal file
@@ -0,0 +1,19 @@
|
||||
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
|
||||
*/
|
||||
export default async function LogIn(): Promise<JSX.Element | undefined> {
|
||||
const session = await auth();
|
||||
if (session) {
|
||||
return (
|
||||
<LogoutButton/>
|
||||
);
|
||||
} else {
|
||||
return (
|
||||
<LoginButton/>
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user