issue-129 tweaks after deploy test

This commit is contained in:
Kurt Hutten
2020-12-05 18:04:11 +11:00
parent fc4906757a
commit 77a50b4f17
6 changed files with 28 additions and 16 deletions

View File

@@ -11,7 +11,7 @@ const UpdatePasswordPage = () => {
const { addMessage } = useFlash()
const { client } = useAuth()
const onSubmit = ({ password, confirm }) => {
if (password !== confirm) {
if (password !== confirm || !password) {
addMessage("Passwords don't match, try again", {
classes: 'bg-red-300 text-red-900',
})
@@ -21,24 +21,20 @@ const UpdatePasswordPage = () => {
.currentUser()
.update({ password })
.then(() => {
addMessage('Email updated', { classes: 'rw-flash-success' })
addMessage('Password updated', { classes: 'rw-flash-success' })
setTimeout(() => {
navigate(routes.home())
}, 500)
})
.catch(() => {
addMessage('Problem updating email', {
addMessage('Problem updating password', {
classes: 'bg-red-300 text-red-900',
})
})
}
return (
<MainLayout>
<Seo
title="Account recovery"
description="Send recovery email"
lang="en-US"
/>
<Seo title="Update Password" description="Update Password" lang="en-US" />
<section className="max-w-md mx-auto mt-20">
<h2 className="text-xl text-indigo-500 pb-4">Reset Password</h2>
@@ -52,7 +48,7 @@ const UpdatePasswordPage = () => {
</span>
<InputTextForm
className="text-xl"
name="email"
name="password"
type="password"
validation={{
required: true,
@@ -63,7 +59,7 @@ const UpdatePasswordPage = () => {
</span>
<InputTextForm
className="text-xl"
name="email"
name="confirm"
type="password"
validation={{
required: true,