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 ( <> Change Password | Society of Socks

Change Password

(value.length >= 8)} hint="Password must be at least 8 characters long" /> (value.length >= 8)} hint="Password must be at least 8 characters long" /> (value === fields.password.value)} hint="Passwords must match" /> ) }