PageSourceSearch

https://platform.leadl.ai/assets/password-reset-confirm-DSOptzef.js

js leadl.ai collected 2026-10-05 12:09:31 UTC 5,392 bytes, 1 lines download raw bytes

1import{j as e}from"./vendor-ui-CMdEc5LK.js";import{u as A,m as D,i as f,C as w,a as p,b as j,c as g,d as v,A as N,j as P,k as y,I as b,B as F,L as _}from"./index-BL1h8BCK.js";import{u as i}from"./vendor-utils-Uxb1l-RZ.js";import{h as q,a as l,N as E,L as r}from"./vendor-react-CFJYUPZF.js";import{u as I}from"./vendor-i18n-EURvDlXD.js";import{A as B}from"./auth-theme-toggle-8xslqGwT.js";import"./vendor-query-BpcEEpAu.js";import"./vendor-date-24nX5Gms.js";const M=({className:d,...c})=>{const{t:s}=I(),{isAuthenticated:L}=A(),k=D(),[u]=q(),[t,C]=l.useState(""),[n,V]=l.useState(""),[o,m]=l.useState(!1),[x,S]=l.useState(null);if(l.useEffect(()=>{const a=u.get("token");a||i.error(s("auth:invalidResetLink",{defaultValue:"Invalid or missing reset token. Please request a new password reset."})),S(a)},[u,s]),L)return e.jsx(E,{to:"/"});if(!x)return e.jsxs("div",{className:f("flex flex-col gap-6",d),...c,children:[e.jsxs(w,{children:[e.jsxs(p,{className:"text-center",children:[e.jsx(j,{className:"text-xl",children:s("auth:invalidResetLink",{defaultValue:"Invalid Reset Link"})}),e.jsx(g,{children:s("auth:invalidResetLinkDescription",{defaultValue:"This password reset link is invalid or has expired. Please request a new password reset."})})]}),e.jsx(v,{children:e.jsxs("div",{className:"grid gap-6",children:[e.jsx("div",{className:"text-center text-sm",children:e.jsx(r,{to:"/forgot-password",className:"underline underline-offset-4 hover:text-primary",children:s("auth:requestNewReset",{defaultValue:"Request new password reset"})})}),e.jsx("div",{className:"text-center text-sm",children:e.jsxs(r,{to:"/login",className:"inline-flex items-center gap-2 underline underline-offset-4 hover:text-primary",children:[e.jsx(N,{className:"h-4 w-4"}),s("auth:backToLogin",{defaultValue:"Back to login"})]})})]})})]}),e.jsxs("div",{className:"text-balance text-center text-xs text-muted-foreground [&_a]:underline [&_a]:underline-offset-4 [&_a]:hover:text-primary",children:[e.jsx(r,{to:"/terms",children:"Terms of Service"})," and"," ",e.jsx(r,{to:"/privacy",children:"Privacy Policy"}),"."]}),e.jsx("div",{className:"flex justify-center",children:e.jsx(P,{})})]});const R=async a=>{if(a.preventDefault(),t!==n){i.error(s("auth:passwordsDoNotMatch",{defaultValue:"Passwords do not match"}));return}if(t.length<6){i.error(s("auth:passwordTooShort",{defaultValue:"Password must be at least 6 characters long"}));return}m(!0);try{await k.mutateAsync({token:x,new_password:t}),i.success(s("auth:passwordResetSuccessful",{defaultValue:"Password reset successful! You are now logged in."}))}catch(h){i.error(h instanceof Error?h.message:s("auth:passwordResetFailed",{defaultValue:"Failed to reset password. The link may have expired."}))}finally{m(!1)}},T=o||!t||!n||t!==n;return e.jsxs("div",{className:f("flex flex-col gap-6",d),...c,children:[e.jsxs(w,{children:[e.jsxs(p,{className:"text-center",children:[e.jsx(j,{className:"text-xl",children:s("auth:setNewPassword",{defaultValue:"Set New Password"})}),e.jsx(g,{children:s("auth:setNewPasswordDescription",{defaultValue:"Enter your new password below. Make sure it's secure and easy to remember."})})]}),e.jsx(v,{children:e.jsx("form",{onSubmit:R,children:e.jsxs("div",{className:"grid gap-6",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(y,{htmlFor:"password",children:s("auth:newPassword",{defaultValue:"New Password"})}),e.jsx(b,{id:"password",type:"password",value:t,onChange:a=>C(a.target.value),disabled:o,required:!0,minLength:6,autoComplete:"new-password",autoFocus:!0})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(y,{htmlFor:"confirmPassword",children:s("auth:confirmPassword",{defaultValue:"Confirm Password"})}),e.jsx(b,{id:"confirmPassword",type:"password",value:n,onChange:a=>V(a.target.value),disabled:o,required:!0,minLength:6,autoComplete:"new-password"}),n&&t!==n&&e.jsx("p",{className:"text-sm text-destructive",children:s("auth:passwordsDoNotMatch",{defaultValue:"Passwords do not match"})})]}),e.jsx(F,{type:"submit",className:"w-full",disabled:T,children:o?e.jsxs(e.Fragment,{children:[e.jsx(_,{className:"mr-2 h-4 w-4 animate-spin"}),s("common:loading")]}):s("auth:resetPassword",{defaultValue:"Reset Password"})}),e.jsx("div",{className:"text-center text-sm",children:e.jsxs(r,{to:"/login",className:"inline-flex items-center gap-2 underline underline-offset-4 hover:text-primary",children:[e.jsx(N,{className:"h-4 w-4"}),s("auth:backToLogin",{defaultValue:"Back to login"})]})})]})})})]}),e.jsxs("div",{className:"text-balance text-center text-xs text-muted-foreground [&_a]:underline [&_a]:underline-offset-4 [&_a]:hover:text-primary",children:[e.jsx(r,{to:"/terms",children:"Terms of Service"})," and"," ",e.jsx(r,{to:"/privacy",children:"Privacy Policy"}),"."]}),e.jsx("div",{className:"flex justify-center",children:e.jsx(P,{})})]})},U=()=>e.jsxs("div",{className:"flex min-h-svh flex-col items-center justify-center gap-6 bg-muted p-6 md:p-10 relative",children:[e.jsx("div",{className:"absolute top-4 right-4",children:e.jsx(B,{})}),e.jsxs("div",{className:"flex w-full max-w-sm flex-col gap-6",children:[e.jsxs("a",{href:"#",className:"flex items-center gap-2 self
1-center font-medium",children:[e.jsx("img",{src:"/logo.png",alt:"LeadL Logo",className:"h-6 w-6 rounded-md object-contain",loading:"lazy"}),"LEADL.AI Platform"]}),e.jsx(M,{})]})]});export{U as PasswordResetConfirmPage};

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.