import {DateTime} from 'luxon' import Link from 'next/link' import {Button, FormController} from '~/components/form' import useUser from '~/hooks/useUser' import redirect from '~/utils/redirectGetInitialProps' ConfirmEmail.getInitialProps = async ({ctx, user}) => { const {axios} = ctx const {data: links} = await axios.get('/api/email/links') if(!user) return redirect(ctx, 302, '/login') if(user.email_confirmed) return redirect(ctx, 302, '/account') return {links} } export default function ConfirmEmail({links}) { const user = useUser() const lastLink = getLastLinkTime(links) return ( <>
In order to make use of account related features, we require you to confirm your email address.
{lastLink ? ( <>We last sent an email to {user.email} at:
{lastLink.time_created.toFormat('LLLL dd, h:mm a')}
This email will be valid until {lastLink.time_created.plus(lastLink.timeout_length).toFormat('LLLL dd, h:mm a')}
If you haven't received it yet, please be patient. Emails can take several minutes to be delivered, and depending on your email provider may also be subject to additional scans or verification before it shows up in your inbox.
Also, be sure to check your spam or junk folders - registration email like the one we sent can occasionally be caught in those.
If you've waited a few minutes, and you're sure it won't arrive, you can click the button below to send another one. If you still have issues, please feel free to contact us.
Click the button below to send a confirmation email.