import React from 'react' import Link from 'next/link' import Head from 'next/head' import Router from 'next/router' import isEmail from 'validator/lib/isEmail' import {FormController, Input, Button} from '~/components/form' import useAccountRedirect from '~/hooks/useAccountRedirect' import {useSetUser} from '~/hooks/useUser' export default function Login(){ const setUser = useSetUser() useAccountRedirect() const redirectAfterLogin = user => { setUser(user) if (user.is_admin) Router.push('/admin') else Router.push('/account') } return ( <>
Need an account? Register here.