some api routes

This commit is contained in:
jane 2022-04-10 14:26:47 -04:00
parent 6591e0987f
commit 6e58f59274
39 changed files with 324 additions and 21 deletions

25
components/userInfo.js Normal file
View file

@ -0,0 +1,25 @@
import { useSession, signIn, signOut } from "next-auth/react";
import styles from "../styles/Components.module.css";
export async function getServerSideProps(context) {
return {
props: {
borderInfo,
},
};
}
export default function UserInfo(borderInfo) {
const { data: session } = useSession();
return (
<p className={styles.description}>
{session ? `Signed in as ${session.user.name}` : "Not signed in"}
<br />
{session ? (
<button onClick={() => signOut()}>Sign Out</button>
) : (
<button onClick={() => signIn()}>Sign In</button>
)}
</p>
);
}