2
2
mirror of https://github.com/Thream/website.git synced 2024-07-21 09:28:32 +02:00
website/pages/authentication/signin.tsx

35 lines
1014 B
TypeScript
Raw Normal View History

2022-08-31 21:44:33 +02:00
import type { NextPage } from 'next'
import useTranslation from 'next-translate/useTranslation'
2022-03-16 12:18:09 +01:00
import { Head } from '../../components/Head'
import { Authentication } from '../../components/Authentication'
import { Header } from '../../components/Header'
2022-08-31 21:44:33 +02:00
import type { FooterProps } from '../../components/Footer'
import { Footer } from '../../components/Footer'
2022-03-16 12:18:09 +01:00
import { authenticationFromServerSide } from '../../tools/authentication'
2021-12-28 16:06:58 +01:00
const Signin: NextPage<FooterProps> = (props) => {
const { version } = props
const { t } = useTranslation()
return (
2022-12-13 22:31:32 +01:00
<>
<Head title={`Thream | ${t('authentication:signin')}`} />
<Header />
<Authentication mode='signin' />
<Footer version={version} />
2022-12-13 22:31:32 +01:00
</>
)
}
export const getServerSideProps = authenticationFromServerSide({
shouldBeAuthenticated: false,
fetchData: async () => {
const { readPackage } = await import('read-pkg')
const { version } = await readPackage()
return { version }
}
})
export default Signin