You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 20, 2023. It is now read-only.
Hi! I am trying to send a reset password email on my custom storefront (Gatsby) but I am having some troubles setting it up. My current forgot-password file looks like this:
importReactfrom"react"import{Layout}from"../../components/layout"import{useMutation}from"urql"import{navigate}from"gatsby"import{SearchProvider}from"../../context/search-provider"constcustomerRecover=` mutation customerRecover ($email: String!) { customerRecover(email: $email) { customerUserErrors { code field message } }}`functionForgotPassword(){const[email,setEmail]=React.useState("")const[customerRecoverToken,getCustomerRecoverToken]=useMutation(customerRecover)consthandleRecover=()=>{letvariables={email: {
email,},}if(email){getCustomerRecoverToken(variables).then(({data: {customerRecover: result}})=>{// We get error responses from the API in the resultif(result.customerUserErrors?.length){thrownewError(result.customerUserErrors)}console.log(result)setTimeout(()=>{navigate("/")},400)}).catch((error)=>{console.log(error)})}}return(<Layout><divclassName="mt-1"><inputid="email"name="email"type="email"autoComplete="email"value={email}onChange={(e)=>setEmail(e.target.value)}requiredclassName="block w-full px-3 py-2 placeholder-gray-400 border border-gray-300 rounded-md shadow-sm appearance-none focus:outline-none focus:ring-mainPink-400 focus:border-mainPink-400 sm:text-sm"/></div><buttononClick={handleRecover}className="flex justify-center w-full px-4 py-2 text-sm font-medium text-white border border-transparent rounded-md shadow-sm bg-mainPink-400 hover:bg-opacity-90 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-mainPink-400">
Inloggen
</button></Layout>)}exportdefaultfunctionForgotPasswordTemplate(props){return(<SearchProvider><ForgotPassword{...props}/></SearchProvider>)}
I am getting typerror: reading undefined customerRecover
Why is this exactly?
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi! I am trying to send a reset password email on my custom storefront (Gatsby) but I am having some troubles setting it up. My current forgot-password file looks like this:
I am getting typerror: reading undefined customerRecover
Why is this exactly?
The text was updated successfully, but these errors were encountered: