PageSourceSearch

https://industrialiq.ai/ResetPasswordPage-CDN1PZ6z.js

js industrialiq.ai collected 2026-10-04 23:45:08 UTC 8,574 bytes, 1 lines download raw bytes

1import{r as e,ap as s,bd as t,am as l,j as a,bu as r,cz as i}from"./index-GDMS6ldZ.js";import{F as n}from"./index.es-BNbyiAtg.js";import{c as o,d,e as c}from"./index-ymjA_K7O.js";function m(){const[m,u]=e.useState(""),[x,h]=e.useState(""),[f,g]=e.useState(""),[b,p]=e.useState(""),[w,v]=e.useState(!1),[y,j]=e.useState(!1),[N,k]=e.useState(!1),[P,S]=e.useState(""),[C,I]=e.useState("checking"),[R,F]=e.useState(""),q=s(),[B]=t(),E=l();e.useEffect(()=>{const e=B.get("token");if(!e)return S(""),I("invalid"),void F("Invalid reset link");S(e);let s=!1;return(async()=>{I("checking"),F("");try{const t=await E.get(`reset-password/check/token?token=${encodeURIComponent(e)}`);if(s)return;if(null==t?void 0:t.success)return void I("valid");I("invalid"),F((null==t?void 0:t.message)||"Invalid or expired reset link")}catch(t){if(s)return;I("invalid"),F((null==t?void 0:t.message)||"Unable to validate reset link")}})(),()=>{s=!0}},[B]);return"checking"===C?a.jsx("div",{className:"flex min-h-full flex-1 flex-col justify-center bg-gray-800 px-6 py-12 lg:px-8",children:a.jsxs("div",{className:"sm:mx-auto sm:w-full sm:max-w-md",children:[a.jsxs("h1",{className:"text-4xl font-semibold text-white",children:["Industrial",a.jsx("span",{className:"font-bold text-blue-600",children:"IQ"})]}),a.jsxs("div",{className:"mt-10 rounded-xl bg-gray-900/60 p-6 ring-1 ring-white/10 shadow-xl",children:[a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx("div",{className:"mt-1 h-10 w-10 rounded-full bg-blue-600/15 ring-1 ring-blue-400/30 flex items-center justify-center",children:a.jsx("div",{className:"h-5 w-5 animate-spin rounded-full border-2 border-blue-400 border-t-transparent"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h2",{className:"text-lg font-semibold text-white",children:"Verifying reset link"}),a.jsx("p",{className:"mt-1 text-sm text-gray-200",children:"Please wait while we confirm your link is still valid."}),a.jsx("p",{className:"mt-3 text-xs text-gray-400",children:"This usually takes a second."})]})]}),a.jsx("div",{className:"mt-6 text-sm text-center",children:a.jsxs("a",{href:r,className:"inline-flex items-center gap-2 px-4 py-2 bg-gradient-to-r from-blue-500 to-blue-600 text-white font-medium rounded-lg shadow-md hover:shadow-lg transition-all duration-200 hover:scale-105 hover:from-blue-600 hover:to-blue-500 transform",children:[a.jsx(n,{icon:o,className:"text-sm"}),"Back to login"]})})]})]})}):"invalid"===C?a.jsx("div",{className:"flex min-h-full flex-1 flex-col justify-center bg-gray-800 px-6 py-12 lg:px-8",children:a.jsxs("div",{className:"sm:mx-auto sm:w-full sm:max-w-md",children:[a.jsxs("h1",{className:"text-4xl font-semibold text-white",children:["Industrial",a.jsx("span",{className:"font-bold text-blue-600",children:"IQ"})]}),a.jsxs("div",{className:"mt-10 rounded-xl bg-gray-900/60 p-6 ring-1 ring-white/10 shadow-xl",children:[a.jsx("h2",{className:"text-left text-2xl/9 font-bold tracking-tight text-white",children:"Reset link not valid"}),a.jsx("p",{className:"mt-2 text-sm text-gray-200",children:R||"This reset link is invalid or has expired."}),a.jsx("div",{className:"mt-5 rounded-lg bg-red-500/10 ring-1 ring-red-400/20 px-4 py-3",children:a.jsx("p",{className:"text-sm font-medium text-red-200",children:"For your security, we can’t let you set a new password with this link."})}),a.jsxs("div",{className:"mt-6 flex flex-col gap-3",children:[a.jsx("a",{href:i,className:"flex w-full justify-center rounded-md bg-cactus-yellow px-3 py-2 text-sm font-semibold text-black shadow-sm hover:bg-cactus-yellow/80 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-600",children:"Request a new reset link"}),a.jsxs("a",{href:r,className:"inline-flex items-center justify-center gap-2 px-4 py-2 bg-gradient-to-r from-blue-500 to-blue-600 text-white font-medium rounded-lg shadow-md hover:shadow-lg transition-all duration-200 hover:scale-105 hover:from-blue-600 hover:to-blue-500 transform",children:[a.jsx(n,{icon:o,className:"text-sm"}),"Back to login"]})]})]})]})}):a.jsx(a.Fragment,{children:a.jsxs("div",{className:"flex min-h-full flex-1 flex-col justify-center bg-gray-800 px-6 py-12 lg:px-8",children:[a.jsxs("div",{className:"sm:mx-auto sm:w-full sm:max-w-sm",children:[a.jsxs("h1",{className:"text-4xl font-semibold text-white",children:["Industrial",a.jsx("span",{className:"font-bold text-blue-600",children:"IQ"})]}),a.jsx("h2",{className:"mt-10 text-left text-2xl/9 font-bold tracking-tight text-white",children:"Reset Password"}),a.jsx("p",{className:"mt-2 text-sm text-gray-200",children:"Enter your new password below."}),a.jsx("div",{className:"mt-4 inline-flex items-center rounded-full bg-green-500/10 px-3 py-1 text-xs font-semibold text-green-200 ring-1 ring-green-400/20",children:"Link verified"})]}),a.jsxs("div",{className:"mt-8 sm:mx-auto sm:w-full sm:max-w-sm",children:[f&&a.jsx("div",{className:"mb-4 p-2 bg-red-100 border border-red-400 text-red-700 rounded",children:f}),b&&a.jsx("div",{className:"mb-4 p-2 bg-green-100 border border-green-400 text-green-700 rounded",children:b}),a.jsxs("form",{onSubmit:async e=>{if(e.preventDefault(),g(""),p(""),"valid"===C&&P)if(m.length<8)g("Password must be at least 8 characters long");else if(m===x){v(!0);try{const e=await(async(e,s)=>{try{const t=await E.post("reset-password/reset",{newPassword:e,token:s});return t.success?{success:!0,message:"Password reset successfully!"}:{success:!1,message:t.message||"An error occurred during password reset"}}catch(t){return{success:!1,message:(null==t?void 0:t.message)||"Failed to reset password. Please try again."}}})(m,P);e.success?(p("Password reset successfully! Redirecting to login..."),setTimeout(()=>q(r),2e3)):g(e.message||"Failed to reset password")}catch(s){g("An unexpected error occurred")}finally{v(!1)}}else g("Passwords do not match");
1else g(R||"Reset link is invalid or expired.")},className:"space-y-6",children:[a.jsxs("div",{children:[a.jsx("label",{htmlFor:"password",className:"text-left block text-sm/6 font-medium text-white",children:"New Password"}),a.jsxs("div",{className:"mt-2 relative",children:[a.jsx("input",{id:"password",name:"password",type:y?"text":"password",required:!0,autoComplete:"new-password",value:m,onChange:e=>u(e.target.value),className:"block w-full rounded-md bg-white px-3 py-1.5 pr-10 text-base text-gray-900 outline outline-1 -outline-offset-1 outline-gray-300 placeholder:text-gray-400 focus:outline focus:outline-2 focus:-outline-offset-2 focus:outline-blue-600 sm:text-sm/6",placeholder:"Enter your new password"}),a.jsx("button",{type:"button",className:"absolute inset-y-0 right-0 pr-3 flex items-center",onClick:()=>j(!y),children:a.jsx(n,{icon:y?d:c,className:"text-gray-400 hover:text-gray-600"})})]}),a.jsx("p",{className:"mt-2 text-xs text-gray-300",children:"Use at least 8 characters."})]}),a.jsxs("div",{children:[a.jsx("label",{htmlFor:"confirmPassword",className:"text-left block text-sm/6 font-medium text-white",children:"Confirm New Password"}),a.jsxs("div",{className:"mt-2 relative",children:[a.jsx("input",{id:"confirmPassword",name:"confirmPassword",type:N?"text":"password",required:!0,autoComplete:"new-password",value:x,onChange:e=>h(e.target.value),className:"block w-full rounded-md bg-white px-3 py-1.5 pr-10 text-base text-gray-900 outline outline-1 -outline-offset-1 outline-gray-300 placeholder:text-gray-400 focus:outline focus:outline-2 focus:-outline-offset-2 focus:outline-blue-600 sm:text-sm/6",placeholder:"Confirm your new password"}),a.jsx("button",{type:"button",className:"absolute inset-y-0 right-0 pr-3 flex items-center",onClick:()=>k(!N),children:a.jsx(n,{icon:N?d:c,className:"text-gray-400 hover:text-gray-600"})})]})]}),a.jsx("div",{children:a.jsx("button",{type:"submit",disabled:w,className:"flex w-full justify-center rounded-md bg-cactus-yellow px-3 py-1.5 text-sm/6 font-semibold text-black shadow-sm hover:bg-cactus-yellow/80 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-600 disabled:opacity-70",children:w?"Resetting...":"Reset Password"})}),a.jsx("div",{className:"text-sm text-center mt-6",children:a.jsxs("a",{href:r,className:"inline-flex items-center gap-2 px-4 py-2 bg-gradient-to-r from-blue-500 to-blue-600 text-white font-medium rounded-lg shadow-md hover:shadow-lg transition-all duration-200 hover:scale-105 hover:from-blue-600 hover:to-blue-500 transform",children:[a.jsx(n,{icon:o,className:"text-sm"}),"Back to login"]})})]})]})]})})}export{m 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.