import Head from "next/head";
import { Box, Grid, Container, IconButton } from "@mui/material";
import { Apple as AppleIcon, Google as GoogleIcon } from "@mui/icons-material";
import { signIn, getSession } from "next-auth/react";
const Login = ({ session }) => {
const buttonStyles = {
borderRadius: 500,
width: "100%",
fontSize: "16px",
fontWeight: "bold",
};
return (
<>
Login
{!session ? (
signIn("google", {
callbackUrl: `https://redaranj-bookish-tribble-56jwjx5wh4j4w-8003.preview.app.github.dev/auth/sso`,
})
}
>
Google
{/*
signIn("apple", {
callbackUrl: `${window.location.origin}/setup`,
})
}
>
*/}
) : null}
{session ? (
{` ${session.user.name ?? session.user.email}.`}
) : null}
>
);
};
export default Login;
export async function getServerSideProps(context) {
const session = (await getSession(context)) ?? null;
return {
props: { session },
};
}