PageSourceSearch

https://knuckl.com/assets/ResetPassword-BIAJQPDS.js

js knuckl.com collected 2026-10-02 01:35:41 UTC 3,188 bytes, 1 lines download raw bytes

1import{a,j as e}from"./vendor-query-CRhh6spR.js";import{b as y,s as m,I as p,B as v,h as i}from"./index-BkVb42KZ.js";import{L as h}from"./label-Xk_s6Ck5.js";import{C as N,b as P,c as L,d as S,a as R}from"./card-CScRmu7W.js";import{K as T}from"./KnucklLogo-Cu1rMULr.js";import{H as k}from"./Head-B4hXUiBE.js";import{u as E}from"./vendor-react-BAmwgVqg.js";import{C as K}from"./check-BtcgJ1Z4.js";import{K as D}from"./key-round-DcNUIiOm.js";import"./vendor-charts-BVeOEGzI.js";import"./vendor-stripe-2y4Jo9_W.js";import"./vendor-supabase-Csx7YFID.js";function _(){const{t:f}=y(),s=f.resetPassword,[o,w]=a.useState(""),[d,x]=a.useState(""),[c,l]=a.useState(!1),[n,g]=a.useState(!1),[H,u]=a.useState(!1),j=E();a.useEffect(()=>{const{data:{subscription:r}}=m.auth.onAuthStateChange(C=>{C==="PASSWORD_RECOVERY"&&u(!0)});return window.location.hash.includes("type=recovery")&&u(!0),()=>r.unsubscribe()},[]);const b=async r=>{if(r.preventDefault(),o!==d){i.error(s.passwordsDontMatch);return}if(o.length<8){i.error(s.passwordTooShort);return}l(!0);try{const{error:t}=await m.auth.updateUser({password:o});if(t)throw t;g(!0),i.success(s.passwordUpdatedToast),setTimeout(()=>j("/auth",{replace:!0}),2e3)}catch(t){i.error(t.message||s.updateFailed)}finally{l(!1)}};return e.jsxs("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:[e.jsx(k,{title:s.headTitle,description:s.headDesc,noindex:!0}),e.jsxs("div",{className:"w-full max-w-md",children:[e.jsx("div",{className:"flex flex-col items-center mb-8",children:e.jsx(T,{size:"lg"})}),e.jsxs(N,{className:"border-border bg-card",children:[e.jsxs(P,{className:"text-center pb-4",children:[e.jsx("div",{className:"flex justify-center mb-2",children:n?e.jsx("div",{className:"h-12 w-12 rounded-full bg-green-100 dark:bg-green-900/30 flex items-center justify-center",children:e.jsx(K,{className:"h-6 w-6 text-green-600 dark:text-green-400"})}):e.jsx("div",{className:"h-12 w-12 rounded-full bg-primary/10 flex items-center justify-center",children:e.jsx(D,{className:"h-6 w-6 text-primary"})})}),e.jsx(L,{className:"text-foreground",children:n?s.passwordUpdatedTitle:s.setNewPasswordTitle}),e.jsx(S,{children:n?s.redirectingToLogin:s.enterNewPassword})]}),e.jsx(R,{children:!n&&e.jsxs("form",{onSubmit:b,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(h,{htmlFor:"new-password",children:s.newPasswordLabel}),e.jsx(p,{id:"new-password",type:"password",name:"new-password",autoComplete:"new-password",autoCapitalize:"none",autoCorrect:"off",spellCheck:!1,enterKeyHint:"next",value:o,onChange:r=>w(r.target.value),required:!0,minLength:8,placeholder:s.atLeast8Chars,className:"mt-1"})]}),e.jsxs("div",{children:[e.jsx(h,{htmlFor:"confirm-password",children:s.confirmPasswordLabel}),e.jsx(p,{id:"confirm-password",type:"password",name:"confirm-password",autoComplete:"new-password",autoCapitalize:"none",autoCorrect:"off",spellCheck:!1,enterKeyHint:"go",value:d,onChange:r=>x(r.target.value),required:!0,minLength:8,placeholder:s.reEnterPassword,className:"mt-1"})]}),e.jsx(v,{type:"submit",className:"w-full",disabled:c,children:c?s.updating:s.updatePasswordBtn})]})})]})]})]})}export{_ 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.