import { createDefaultAuth } from '../utilities/auth'
import { GetServerSideProps } from 'next'

const Home = () => {
	return (
		<></>
	)
}

export const getServerSideProps: GetServerSideProps = async ({ req, res }) => {
	const auth = createDefaultAuth()
	const session = auth.getSession(req, res)

	if (!session) {
		return {
			redirect: {
				destination: '/api/a/auth/log-in',
				permanent: false,
			},
		}
	}

	return {
		redirect: {
			destination: '/my/folders',
			permanent: false,
		}
	}
}

export default Home
