Revert "issue-129 tweaks after deploy test"
This reverts commit 77a50b4f17.
This commit is contained in:
@@ -33,6 +33,7 @@ const Routes = () => {
|
||||
return (
|
||||
<Router>
|
||||
<Route path="/account-recovery/update-password" page={UpdatePasswordPage} name="updatePassword" />
|
||||
{/* <Route path="/account-recovery/update-password/{recoveryToken}" page={UpdatePasswordPage} name="updatePassword" /> */}
|
||||
<Route path="/account-recovery" page={AccountRecoveryPage} name="accountRecovery" />
|
||||
<Route path="/" page={PartsPage} name="home" />
|
||||
<Route notfound page={NotFoundPage} />
|
||||
|
||||
@@ -10,7 +10,7 @@ const InputText = ({ value, isEditable, onChange, className }) => {
|
||||
className
|
||||
)}
|
||||
>
|
||||
<div className="absolute inset-0 mb-2 rounded bg-gray-200 shadow-inner" />
|
||||
<div className="absolute inset-0 mb-2 rounded bg-gray-200 shadow-inners" />
|
||||
<input
|
||||
className="pl-2 pt-1 text-indigo-800 font-medium mb-px pb-px bg-transparent relative"
|
||||
onChange={onChange}
|
||||
|
||||
@@ -6,13 +6,10 @@ import InputTextForm from 'src/components/InputTextForm'
|
||||
import OutBound from 'src/components/OutBound'
|
||||
import { Form, Submit } from '@redwoodjs/forms'
|
||||
import { useAuth } from '@redwoodjs/auth'
|
||||
import { useFlash } from '@redwoodjs/web'
|
||||
import { Link, routes } from '@redwoodjs/router'
|
||||
import { subscribe } from 'src/helpers/subscribe'
|
||||
|
||||
const LoginModal = ({ open, onClose, shouldStartWithSignup = false }) => {
|
||||
const { logIn, signUp } = useAuth()
|
||||
const { addMessage } = useFlash()
|
||||
|
||||
const [tab, setTab] = useState(shouldStartWithSignup ? 0 : 1)
|
||||
const onTabChange = (_, newValue) => {
|
||||
@@ -25,9 +22,6 @@ const LoginModal = ({ open, onClose, shouldStartWithSignup = false }) => {
|
||||
const onSubmitSignUp = async ({ email, password, name, userName }) => {
|
||||
try {
|
||||
setError('')
|
||||
if (checkBox) {
|
||||
subscribe({ email, addMessage })
|
||||
}
|
||||
await signUp({
|
||||
email,
|
||||
password,
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
export const subscribe = ({ email, addMessage }) => {
|
||||
// subscribe to mailchimp newsletter
|
||||
const path = window.location.hostname + window.location.pathname
|
||||
try {
|
||||
fetch(
|
||||
`https://kurthutten.us10.list-manage.com/subscribe/post-json?u=cbd8888e924bdd99d06c14fa5&id=6a765a8b3d&EMAIL=${email}&FNAME=Kurt&PATHNAME=${path}&c=__jp0`
|
||||
)
|
||||
} catch (e) {
|
||||
setTimeout(() => {
|
||||
addMessage('Problem subscribing to newsletter', {
|
||||
classes: 'bg-red-300 text-red-900',
|
||||
})
|
||||
}, 1000)
|
||||
}
|
||||
}
|
||||
@@ -103,6 +103,10 @@ const MainLayout = ({ children }) => {
|
||||
})
|
||||
})
|
||||
} else if (key === 'recovery_token') {
|
||||
// http://localhost:8910/#recovery_token=LwsC-KpgmiDwGo-ZcGH0tA
|
||||
// https://mandrillapp.com/track/click/31128206/cadhub.xyz?p=eyJzIjoiWFlFbDk5YTVYU0FOSmEtZ3ZtUXlDSW13QURrIiwidiI6MSwicCI6IntcInVcIjozMTEyODIwNixcInZcIjoxLFwidXJsXCI6XCJodHRwczpcXFwvXFxcL2NhZGh1Yi54eXpcXFwvI3JlY292ZXJ5X3Rva2VuPUx3c0MtS3BnbWlEd0dvLVpjR0gwdEFcIixcImlkXCI6XCJjODU1ZWM1MjZiZmQ0Y2JmYmUyNmM4OTk2ZGU4ODczOFwiLFwidXJsX2lkc1wiOltcIjJkMjljMDI0NTY5MzcxODcxMmI0ODA0M2U3MDYyOTA1ZDc1NzVkNjlcIl19In0
|
||||
// #recovery_token=LwsC-KpgmiDwGo-ZcGH0tA
|
||||
// navigate(routes.updatePassword({ recoveryToken: token }))
|
||||
client
|
||||
.recover(token, true)
|
||||
.then(() => {
|
||||
|
||||
@@ -11,7 +11,7 @@ const UpdatePasswordPage = () => {
|
||||
const { addMessage } = useFlash()
|
||||
const { client } = useAuth()
|
||||
const onSubmit = ({ password, confirm }) => {
|
||||
if (password !== confirm || !password) {
|
||||
if (password !== confirm) {
|
||||
addMessage("Passwords don't match, try again", {
|
||||
classes: 'bg-red-300 text-red-900',
|
||||
})
|
||||
@@ -21,20 +21,24 @@ const UpdatePasswordPage = () => {
|
||||
.currentUser()
|
||||
.update({ password })
|
||||
.then(() => {
|
||||
addMessage('Password updated', { classes: 'rw-flash-success' })
|
||||
addMessage('Email updated', { classes: 'rw-flash-success' })
|
||||
setTimeout(() => {
|
||||
navigate(routes.home())
|
||||
}, 500)
|
||||
})
|
||||
.catch(() => {
|
||||
addMessage('Problem updating password', {
|
||||
addMessage('Problem updating email', {
|
||||
classes: 'bg-red-300 text-red-900',
|
||||
})
|
||||
})
|
||||
}
|
||||
return (
|
||||
<MainLayout>
|
||||
<Seo title="Update Password" description="Update Password" lang="en-US" />
|
||||
<Seo
|
||||
title="Account recovery"
|
||||
description="Send recovery email"
|
||||
lang="en-US"
|
||||
/>
|
||||
|
||||
<section className="max-w-md mx-auto mt-20">
|
||||
<h2 className="text-xl text-indigo-500 pb-4">Reset Password</h2>
|
||||
@@ -48,7 +52,7 @@ const UpdatePasswordPage = () => {
|
||||
</span>
|
||||
<InputTextForm
|
||||
className="text-xl"
|
||||
name="password"
|
||||
name="email"
|
||||
type="password"
|
||||
validation={{
|
||||
required: true,
|
||||
@@ -59,7 +63,7 @@ const UpdatePasswordPage = () => {
|
||||
</span>
|
||||
<InputTextForm
|
||||
className="text-xl"
|
||||
name="confirm"
|
||||
name="email"
|
||||
type="password"
|
||||
validation={{
|
||||
required: true,
|
||||
|
||||
Reference in New Issue
Block a user