import {useSetUser} from '~/hooks/useUser' import Head from 'next/head' import Router from 'next/router' import redirect from '~/utils/redirectGetInitialProps' import {FormController, Input, Button} from '~/components/form' ChangePassword.getInitialProps = async function({ctx, user}) { if(!user) return redirect(ctx, 302, '/login') if(!user.email_confirmed) return redirect(ctx, 302, '/account/email/confirm') return {} } export default function ChangePassword() { const setUser = useSetUser() function afterChange(user) { setUser(user); Router.push('/account') } return ( <>