import withUser from '../lib/session';
import { LoginPage } from '../components/LoginPage/LoginPage';

export default LoginPage;

export const getServerSideProps = withUser(async (ctx, user) => {
  if (user) {
    return {
      redirect: {
        destination: '/',
        permanent: false,
      },
    };
  }

  return {
    props: {},
  };
});
