PageSourceSearch

https://www.template.net/assets/reset-password._userId._code-Bw0KEFpT.mjs

js template.net collected 2026-09-24 15:20:10 UTC 6,660 bytes, 1 lines download raw bytes

1import{r as e,j as s}from"./globals-BMcmkdEs.mjs";import{u as D,s as B}from"./globals-store-BM78bW3M.mjs";import{a as g,M as $}from"./index-DUMWkLFm.mjs";import{a as z}from"./url-kTDias0L.mjs";import{b as R}from"./csr-C7B5tWkp.mjs";import"./router-PMS2L5za.mjs";import"./useCSR-CR_1-KzY.mjs";import"./common-CUwVOe11.mjs";import"./subscription-DJ94mgUd.mjs";import"./cross-window-zqBdgh6Q.mjs";import"./Header-Ctupkg_3.mjs";import"./footer-Dbvw_wlB.mjs";import"./event-listener-C4UMK6l2.mjs";import"./AuthenSection-BbYlSK4d.mjs";import"./popup-ChWqG3l9.mjs";import"./PricingButton-ifBVv9Mr.mjs";import"./index-CkrfVaV_.mjs";import"./AutoComplete2-D1g_OufM.mjs";import"./LoadMoreComponent-B2a3zFPo.mjs";import"./index-D8ccp5WO.mjs";import"./product-jLfMkmZf.mjs";import"./index-bn9fV1ue.mjs";import"./index-Da0yZG-B.mjs";import"./sidebar-new-CqgIe3zg.mjs";import"./ai-templates.store-CdICC5cI.mjs";import"./generateType-CsrXzyzk.mjs";import"./ReportPopup-ypqzd-v3.mjs";import"./workspace-DZuqHb9_.mjs";import"./format-text-BHigmckY.mjs";import"./product-CnNEWhFW.mjs";import"./EditorIcon-BtqzgUzN.mjs";import"./useTemplateList-B1TQDukW.mjs";import"./probe-image-dimensions-BR3q9yoV.mjs";import"./url-ClSU4SeM.mjs";function j({valid:a}){return s.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[s.jsx("path",{d:"M0 10C0 4.47715 4.47715 0 10 0C15.5228 0 20 4.47715 20 10C20 15.5228 15.5228 20 10 20C4.47715 20 0 15.5228 0 10Z",fill:a?"#DCFAE6":"#D5D7DA"}),s.jsx("path",{d:"M6.25 10L8.75 12.5L13.75 7.5",stroke:a?"#079455":"#fff","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})]})}function T(){return s.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:s.jsx("path",{d:"M15.8346 9.9974H4.16797M4.16797 9.9974L10.0013 15.8307M4.16797 9.9974L10.0013 4.16406",stroke:"#A4A7AE",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})})}function Z(){return s.jsxs("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[s.jsx("path",{d:"M0 24C0 10.7452 10.7452 0 24 0C37.2548 0 48 10.7452 48 24C48 37.2548 37.2548 48 24 48C10.7452 48 0 37.2548 0 24Z",fill:"#DCFAE6"}),s.jsx("path",{d:"M19.5 24L22.5 27L28.5 21M34 24C34 29.5228 29.5228 34 24 34C18.4772 34 14 29.5228 14 24C14 18.4772 18.4772 14 24 14C29.5228 14 34 18.4772 34 24Z",stroke:"#079455","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})]})}function vs(){const{userId:a,code:_}=R.useParams(),[t,v]=e.useState(""),[i,C]=e.useState(""),[w,o]=e.useState(""),[k,h]=e.useState(!1),[p,N]=e.useState(!1),[c,S]=e.useState(!1),[l,b]=e.useState(!1),[y,P]=e.useState("Your password has been reset successfully"),[x,M]=e.useState(""),[n,E]=e.useState(5);e.useEffect(()=>{if(!l)return;if(n<=0){window.location.href="/";return}const r=setTimeout(()=>E(m=>m-1),1e3);return()=>clearTimeout(r)},[l,n]);const d=t.length>=8,u=/[^a-zA-Z0-9]/.test(t),A=t.length===0||i.length===0,I=async r=>{if(r.preventDefault(),o(""),t!==i){o("Password is not matching.");return}if(!d){o("Password must be at least 8 characters");return}if(!u){o("Password must contain one special character");return}h(!0);const m=D.getState().authToken,L="/user-activity/user/change-password";try{(await B.post(L,{password:t,encodeUserId:a,token:_},{headers:{Authorization:`Bearer ${m}`}})).status===200&&(b(!0),P("Your password has been reset successfully"))}catch(f){M(f?.response?.data?.msg||"Something went wrong. Please try again.")}finally{h(!1)}};return l?s.jsxs("div",{className:"m-auto p-sm xl:p-xl text-center",id:"reset-password-form",children:[s.jsxs("div",{className:"reset-password-popup__result",children:[s.jsx("div",{className:"reset-password-popup__icon",children:s.jsx(Z,{})}),s.jsx("h2",{className:"reset-password-popup__title",children:y}),s.jsx("p",{className:"reset-password-popup__description",children:"You can now log back in using your new password"})]}),s.jsxs("a",{href:"/",className:"btn btn-primary btn-2xl rounded w-full reset-password-popup__success",onClick:()=>window.location.href="/",children:[s.jsxs("span",{className:"reset-password-popup__success-text",children:["Sign in (",n,"s)"]}),s.jsx("span",{className:"reset-password-popup__success-progress"},n)]})]}):s.jsxs("form",{className:"m-auto p-sm xl:p-xl text-center",id:"reset-password-form",onSubmit:I,children:[s.jsx("img",{src:z("new-logo-1.svg"),alt:"Template.net",className:"authen-logo"}),s.jsx("h2",{className:"reset-password-popup__title",children:"Set new password"}),s.jsx("p",{className:"reset-password-popup__description",children:"Don't worry! We'll send you an email to help you reset your password"}),s.jsxs("div",{className:"reset-password-popup__form",children:[s.jsxs("div",{className:"reset-password-popup__field",children:[s.jsx("label",{className:"reset-password-popup__label",children:"Password"}),s.jsx(g,{id:"new-password",name:"new-password",autoComplete:"new-password",size:"2xl",rounded:!0,placeholder:"Enter your new password",type:p?"text":"password",value:t,onChange:r=>{v(r.target.value),o("")},iconEnd:s.jsx("svg",{width:24,height:24,children:s.jsx("use",{href:`/assets/sprites/icon-commons.svg?3f6e14a6${p?"#view":"#view-off"}`})}),onClickIconEnd:()=>N(!p)})]}),s.jsxs("div",{className:"reset-password-popup__field",children:[s.jsx("label",{className:"reset-password-popup__label",children:"Confirm password"}),s.jsx(g,{id:"confirm-password",name:"confirm-password",autoComplete:"new-password",size:"2xl",rounded:!0,placeholder:"Confirm your new password",type:c?"text":"password",value:i,onChange:r=>{C(r.target.value),o("")},iconEnd:s.jsx("svg",{width:24,height:24,children:s.jsx("use",{href:`/assets/sprites/icon-commons.svg?3f6e14a6${c?"#view":"#view-off"}`})}),onClickIconEnd:()=>S(!c)})]}),w&&s.jsx("span",{className:"reset-password-popup__error",children:w}),x&&s.jsx("span",{className:"reset-password-popup__error",children:x}),s.jsxs("div",{className:"reset-password-popup__validations",children:[s.jsxs("div",{className:`reset-password-popup__rule ${d?"valid":""}`,children:[s.jsx(j,{valid:d}),"Must be at least 8 characters"]}),s.jsxs("div",{className:`reset-password-popup__rule ${u?"valid":""}`,children:[s.jsx(j,{valid:u}),"Must contain one special character"]})]}),s.jsx($,{variant:"primary",rounded:!0,size:"2xl",content:"center",disabled:A,className:`reset-password-popup__submit w-full ${k?"loading":""}`,type:"submit",children:"Reset password"}),s.jsxs("a",{href:"/",className:"reset-password-popup__back-link",children:[s.jsx(T,{}),"Back to log in"]})]})]})}export{vs as component};

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.