20 lines
349 B
TypeScript
20 lines
349 B
TypeScript
|
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: {},
|
||
|
};
|
||
|
});
|