import { routes, navigate } from '@redwoodjs/router' import { useAuth } from '@redwoodjs/auth' import { Form, Submit } from '@redwoodjs/forms' import { useFlash } from '@redwoodjs/web' import InputTextForm from 'src/components/InputTextForm' import MainLayout from 'src/layouts/MainLayout' import Seo from 'src/components/Seo/Seo' const UpdatePasswordPage = () => { const { addMessage } = useFlash() const { client } = useAuth() const onSubmit = ({ password, confirm }) => { if (password !== confirm) { addMessage("Passwords don't match, try again", { classes: 'bg-red-300 text-red-900', }) return } client .currentUser() .update({ password }) .then(() => { addMessage('Email updated', { classes: 'rw-flash-success' }) setTimeout(() => { navigate(routes.home()) }, 500) }) .catch(() => { addMessage('Problem updating email', { classes: 'bg-red-300 text-red-900', }) }) } return (

Reset Password

password: confirm:
Update
) } export default UpdatePasswordPage