PageSourceSearch

https://smartmail.ai/assets/SetNewPasswordPage-JKZhifNn.js

js smartmail.ai collected 2026-10-05 14:17:19 UTC 2,497 bytes, 1 lines download raw bytes

1import{r as n,A as w,b as p,a as h,j as e,B as g,L as f}from"./index-BrT3F50e.js";import{A as P}from"./AuthPageLayout-DkODiInx.js";import{F as o}from"./index-DObnsLqY.js";import{I as d}from"./index-BI2D8MSW.js";import"./useForm-BVKnLQxW.js";import"./row-D-CZ3Hqh.js";import"./useBreakpoint-FD8ghq8d.js";import"./getAllowClear-C4A34otO.js";import"./Input-DOcZa3u3.js";import"./TextArea-BpydDq59.js";function A(){const[m,c]=n.useState(!1),[a]=o.useForm(),{message:i}=w.useApp(),l=p();n.useEffect(()=>{const s=window.location.search;if(s){const t=new URLSearchParams(s).get("code");t&&a.setFieldValue("code",t)}},[a]);const u=n.useCallback(async s=>{try{c(!0);const r=await h.setNewPassword(s),{message:t}=r;i.success(t),setTimeout(()=>{l({to:"/signin"})},100)}catch(r){i.error(r?.message||"Failed to set new password")}finally{c(!1)}},[i,l]);return e.jsxs(P,{title:"Set New Password",subtitle:"Enter the reset code from your email and choose a new password.",children:[e.jsxs(o,{form:a,layout:"vertical",onFinish:u,autoComplete:"off",children:[e.jsx(o.Item,{name:"code",label:"Reset Code",initialValue:new URLSearchParams(window.location.search).get("code")||"",rules:[{required:!0,message:"Please enter the reset code"}],children:e.jsx(d,{placeholder:"Enter your reset code",style:{height:44,borderRadius:10}})}),e.jsx(o.Item,{name:"new_password",label:"New Password",rules:[{required:!0,message:"Please enter your new password"},{min:8,message:"Password must be at least 8 characters"},{validator:(s,r)=>[...r].length<=32?Promise.resolve():Promise.reject(new Error("Password must be at most 32 characters"))}],children:e.jsx(d.Password,{placeholder:"Enter new password",style:{height:44,borderRadius:10}})}),e.jsx(o.Item,{name:"confirm_password",label:"Confirm Password",dependencies:["new_password"],rules:[{required:!0,message:"Please confirm your password"},({getFieldValue:s})=>({validator(r,t){return!t||s("new_password")===t?Promise.resolve():Promise.reject(new Error("Passwords do not match"))}})],children:e.jsx(d.Password,{placeholder:"Confirm new password",style:{height:44,borderRadius:10}})}),e.jsx(o.Item,{style:{marginBottom:12},children:e.jsx(g,{type:"primary",htmlType:"submit",loading:m,block:!0,style:{height:48,borderRadius:10,fontWeight:600,fontSize:16},children:"Set New Password"})})]}),e.jsx("div",{style:{textAlign:"center"},children:e.jsx(f,{to:"/signin",style:{fontSize:13,color:"rgba(28, 29, 31, 0.5)"},children:"Back to Sign In"})})]})}export{A as SetNewPasswordPage};

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.