PageSourceSearch

https://aieducator.tools/_spa/assets/ForgotPassword-zROiicHN.js

js aieducator.tools collected 2026-10-01 14:31:54 UTC 3,389 bytes, 1 lines download raw bytes

1import{r as a,j as e,L as i,C as f,l as p}from"./index-DU7EiW5Z.js";import{u as b}from"./useNoIndex-BcxLLkKK.js";import{l as j}from"./Normal_(1)_1770767936075-DWlfSefL.js";import{A as c}from"./arrow-left-Duva7iIn.js";import{M as y}from"./mail-kXcN9TSZ.js";function E(){b();const[s,m]=a.useState(""),[l,o]=a.useState(!1),[x,u]=a.useState(!1),[r,t]=a.useState(""),h=async n=>{if(n.preventDefault(),!s||!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s)){t("Please enter a valid email address");return}o(!0),t("");try{const d=await fetch("/api/auth/forgot-password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:s})});if(d.ok)u(!0);else{const g=await d.json();t(g.message||"Something went wrong")}}catch{t("Something went wrong. Please try again.")}finally{o(!1)}};return e.jsx("div",{className:"min-h-screen bg-white dark:bg-gray-950 flex items-center justify-center px-5",children:e.jsxs("div",{className:"w-full max-w-[400px]",children:[e.jsx("div",{className:"flex items-center mb-8",children:e.jsx(i,{href:"/",children:e.jsx("img",{src:j,alt:"AI Educator Tools",className:"h-8 w-auto"})})}),x?e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"w-16 h-16 bg-green-100 dark:bg-green-900/30 rounded-full flex items-center justify-center mx-auto mb-5",children:e.jsx(f,{size:32,className:"text-green-600"})}),e.jsx("h1",{className:"text-[28px] font-bold text-gray-900 dark:text-white mb-3",children:"Check your email"}),e.jsx("p",{className:"text-base text-gray-500 dark:text-gray-400 mb-8",children:"Check your email for a password reset link. If you don't see it, check your spam folder."}),e.jsxs(i,{href:"/signin",className:"text-[14px] text-[#e81b6e] font-medium hover:underline inline-flex items-center gap-1.5",children:[e.jsx(c,{size:14})," Back to sign in"]})]}):e.jsxs(e.Fragment,{children:[e.jsx("h1",{className:"text-[28px] font-bold text-gray-900 dark:text-white mb-2",children:"Reset your password"}),e.jsx("p",{className:"text-base text-gray-500 dark:text-gray-400 mb-6",children:"Enter your email and we'll send you a reset link."}),e.jsxs("form",{onSubmit:h,className:"space-y-4",noValidate:!0,children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"resetEmail",className:"sr-only",children:"Email Address"}),e.jsx("input",{id:"resetEmail",type:"email",placeholder:"[email protected]",value:s,onChange:n=>{m(n.target.value),t("")},className:`w-full h-12 px-4 text-[15px] bg-white dark:bg-gray-900 border border-[#D1D5DB] dark:border-gray-700 rounded-lg focus:outline-none focus:border-[#e81b6e] focus:ring-2 focus:ring-[#e81b6e]/20 transition-all duration-200 ${r?"border-red-500":""}`,autoFocus:!0}),r&&e.jsx("p",{className:"text-[13px] text-red-500 mt-1",children:r})]}),e.jsx("button",{type:"submit",disabled:l||!s,className:"w-full h-12 bg-[#e81b6e] hover:bg-[#c4175d] text-white text-base font-semibold rounded-lg transition-colors duration-150 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2",children:l?e.jsx(p,{className:"animate-spin",size:20}):e.jsxs(e.Fragment,{children:[e.jsx(y,{size:18})," Send Reset Link"]})})]}),e.jsx("p",{className:"text-center mt-6",children:e.jsxs(i,{href:"/signin",className:"text-[14px] text-[#e81b6e] font-medium hover:underline inline-flex items-center gap-1.5",children:[e.jsx(c,{size:14})," Back to sign in"]})})]})]})})}export{E 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.