App directory #4
This commit is contained in:
parent
69706053c6
commit
4d743c5e67
86 changed files with 223 additions and 107 deletions
30
apps/metamigo-frontend/app/login/_components/Login.tsx
Normal file
30
apps/metamigo-frontend/app/login/_components/Login.tsx
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
"use client";
|
||||
|
||||
import { FC } from "react";
|
||||
import { Button } from "@mui/material";
|
||||
import { signIn, signOut, useSession } from "next-auth/react";
|
||||
|
||||
export const Login: FC = () => {
|
||||
const { data: session } = useSession();
|
||||
|
||||
return (
|
||||
<>
|
||||
{!session && (
|
||||
<>
|
||||
Not signed in <br />
|
||||
<Button variant="contained" onClick={signIn as any}>
|
||||
Sign in
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
{session && (
|
||||
<>
|
||||
Signed in as {session.user?.email} <br />
|
||||
<Button variant="contained" onClick={signOut as any}>
|
||||
Sign out
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
5
apps/metamigo-frontend/app/login/page.tsx
Normal file
5
apps/metamigo-frontend/app/login/page.tsx
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
import { Login } from "./_components/Login";
|
||||
|
||||
export default function Page() {
|
||||
return <Login />;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue