1import{u as x,r as a,a as e,j as s,d as g}from"./index-4ce00ee7.js";import{d as r}from"./index-e629a575.js";import{t as l}from"./index-51f3a61d.js";import{w}from"./warning-ed9d4d8a.js";const f="/assets/back-arrow-1b3e60c5.svg",N=()=>{const{isAuthenticated:o,forgotPassword:c}=x(),[i,m]=a.useState("");a.useEffect(()=>{o&&e.navigate(e.routes.dashboard())},[o]);const n=a.useRef();a.useEffect(()=>{n.current.focus()},[]);const d=async u=>{const t=await c(u.username);t.error?m(t.error):(l.toast.success("A link to reset your password was sent to "+t.email),setTimeout(()=>{e.navigate(e.routes.login())},1))};return s.jsxs(s.Fragment,{children:[s.jsx(g.MetaTags,{title:"Forgot Password"}),s.jsx("main",{className:"max-w-full w-[32rem] mx-auto mt-12",children:s.jsxs("div",{className:"bg-white p-8 rounded-lg space-y-5",children:[s.jsx("h2",{className:"text-2xl text-dark font-bold",children:"Forgot Password"}),s.jsx(l.Toaster,{toastOptions:{className:"rw-toast",duration:6e3}}),s.jsxs(r.Form,{onSubmit:d,className:"rw-form-wrapper space-y-5",children:[i&&s.jsxs("div",{className:"flex items-center rw-field-error bg-pink-100 p-2",children:[s.jsx("img",{src:w,alt:"warning"}),s.jsx("span",{className:"ml-1 mt-0.5",children:i})]}),s.jsxs("div",{children:[s.jsx(r.Label,{name:"username",className:"text-gray-900",errorClassName:"rw-label rw-label-error",children:"Email"}),s.jsx(r.TextField,{name:"username",className:"rw-input",errorClassName:"rw-input rw-input-error",ref:n,validation:{required:{value:!0,message:"*Required"}}}),s.jsx(r.FieldError,{name:"username",className:"rw-field-error"})]}),s.jsx(r.Submit,{className:"w-full bg-primary-500 hover:bg-orange-600 text-white rounded-lg p-2.5",children:"Submit"})]}),s.jsxs(e.Link,{to:e.routes.login(),className:"flex justify-center items-center",children:[s.jsx("img",{src:f,alt:"back icon",className:"pr-2"}),"Back to login"]})]})})]})};export{N as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.