PageSourceSearch

https://velaflow.com/_next/static/chunks/pages/settings/change-password-aed58372e3eda0ef.js

js velaflow.com collected 2026-09-24 13:03:14 UTC 6,735 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6864],{25035:(e,s,r)=>{"use strict";r.d(s,{A:()=>n});var t=r(37876);r(14232);var a=r(96145);let n=e=>{let{onBack:s,text:r}=e;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex items-center ml-7 space-x-2 mb-6",children:[(0,t.jsx)(a.In,{onClick:s,id:"arrow-left-icn",className:"w-5 h-5 align-middle inline-block cursor-pointer"}),(0,t.jsx)(a.DZ,{type:"h2",text:r,className:"text-14 text-black"})]}),(0,t.jsx)("hr",{className:"my-2 pl-0 border-dividerGrey"})]})}},51324:(e,s,r)=>{"use strict";r.r(s),r.d(s,{__N_SSP:()=>m,default:()=>f});var t=r(37876),a=r(14232),n=r(96145),l=r(81220),o=r(91408),i=r(89099),d=r(25035),c=r(15234),p=r(10553);let u=o.Ik().shape({old_password:o.Yj().required("Current password is required"),password:o.Yj().min(8,"Min 8 characters").required("New password is required").test("not-same-as-old","New password must be different from current password",function(e){let{old_password:s}=this.parent;return e!==s}),password_confirmation:o.Yj().oneOf([o.KR("password")],"Passwords do not match").required("Confirm password is required")}),x=()=>{let e=(0,i.useRouter)(),[s,r]=(0,a.useState)(!1),[o,x]=(0,a.useState)({}),[w,h]=(0,a.useState)(""),[m,f]=(0,a.useState)(!1),[g,j]=(0,a.useState)({old_password:"",password:"",password_confirmation:""}),[y,b]=(0,a.useState)({old_password:!1,password:!1,password_confirmation:!1}),N=()=>{(0,p.signOut)({callbackUrl:"/login"})};(0,a.useEffect)(()=>{m&&setTimeout(()=>{f(!1),N()},2e3)});let _=()=>{e.push("/settings")},v=e=>{b({...y,[e]:!y[e]})},k=e=>{j({...g,[e.target.name]:e.target.value}),h(null)},C=async e=>{e.preventDefault();let{old_password:s,password:t,password_confirmation:a}=g;try{await u.validate(g,{abortEarly:!1}),x({})}catch(s){let e={};s.inner?s.inner.forEach(s=>{e[s.path]=s.message}):e[s.path]=s.message,x(e);return}try{r(!0);let e=new FormData;e.append("old_password",s),e.append("password",t),e.append("password_confirmation",a),(await (0,l.ec)(e)).error||f(!0)}catch(e){var n,o;h(null==e||null==(o=e.response)||null==(n=o.data)?void 0:n.message)}finally{r(!1)}};return(0,t.jsxs)("div",{className:"w-full max-w-2xl py-6",children:[(0,t.jsx)(d.A,{onBack:_,text:"Change password"}),(0,t.jsxs)("form",{className:"space-y-6 p-4 sm:ml-4",onSubmit:C,autoComplete:"off",children:[(0,t.jsxs)("div",{className:"grid sm:grid-cols-1 gap-4 w-full sm:w-2/3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(n.pd,{type:y.old_password?"text":"password",placeholder:"Current password",autoComplete:"new-password",value:g.old_password,name:"old_password",onChange:k,className:"w-full pl-10 pr-10 h-40 px-4 py-3 text-black text-12 border border-grey rounded outline-none focus:ring-2 focus:border-none focus:primary",suffix:(0,t.jsx)("span",{className:"absolute text-center right-4 top-1/2 -translate-y-1/2 cursor-pointer",children:(0,t.jsx)(n.In,{id:y.old_password?"eye-cut-icn":"eye-icn",onClick:()=>v("old_password"),width:20,height:16,className:"inline-block text-grey"})}),prefix:(0,t.jsx)("span",{className:"absolute left-4 top-1/2 -translate-y-1/2",children:(0,t.jsx)(n.In,{id:"password-icn",width:16,height:16,className:"inline-block text-grey"})})}),o.old_password&&(0,t.jsx)("p",{className:"pl-2 text-red text-12",children:o.old_password})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(n.pd,{type:y.password?"text":"password",placeholder:"New password",autoComplete:"new-password",value:g.password,name:"password",onChange:k,className:"w-full pl-10 pr-10 h-40 px-4 py-3 text-black text-12 border border-grey rounded outline-none focus:ring-2 focus:border-none focus:primary",suffix:(0,t.jsx)("span",{className:"absolute text-center right-4 top-1/2 -translate-y-1/2 cursor-pointer",children:(0,t.jsx)(n.In,{id:y.password?"eye-cut-icn":"eye-icn",onClick:()=>v("password"),width:20,height:16,className:"inline-block text-grey"})}),prefix:(0,t.jsx)("span",{className:"absolute left-4 top-1/2 -translate-y-1/2",children:(0,t.jsx)(n.In,{id:"password-icn",width:16,height:16,className:"inline-block text-grey"})})}),o.password&&(0,t.jsx)("p",{className:"pl-2 text-red text-12",children:o.password})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(n.pd,{type:y.password_confirmation?"text":"password",placeholder:"Confirm password",autoComplete:"new-password",value:g.password_confirmation,name:"password_confirmation",onChange:k,className:"w-full pl-10 pr-10 h-40 px-4 py-3 text-black text-12 border border-grey rounded outline-none focus:ring-2 focus:border-none focus:primary",suffix:(0,t.jsx)("span",{className:"absolute text-center right-4 top-1/2 -translate-y-1/2 cursor-pointer",children:(0,t.jsx)(n.In,{id:y.password_confirmation?"eye-cut-icn":"eye-icn",onClick:()=>v("password_confirmation"),width:20,height:16,className:"inline-block text-grey"})}),prefix:(0,t.jsx)("span",{className:"absolute left-4 top-1/2 -translate-y-1/2",children:(0,t.jsx)(n.In,{id:"password-icn",width:16,height:16,className:"inline-block text-grey"})})}),o.password_confirmation&&(0,t.jsx)("p",{className:"pl-2 text-red text-12",children:o.password_confirmation})]}),w&&(0,t.jsx)("p",{className:"pl-2 text-red text-12",children:w})]}),(0,t.jsxs)("div",{className:"flex w-full sm:w-1/2 space-x-4",children:[(0,t.jsx)(n.$n,{type:"submit",disabled:s,className:"bg-primary text-12 w-full text-white px-2 py-2 rounded hover:bg-blue-700",children:s?(0,t.jsx)("div",{className:"flex items-center justify-center",children:(0,t.jsx)(n.aH,{})}):"Save changes"}),(0,t.jsx)(n.$n,{type:"button",onClick:_,className:"border text-12 border-grey w-full text-black px-2 py-2 rounded hover:bg-gray-100",children:"Cancel"})]})]}),(0,t.jsx)(c.A,{isOpen:m,onClose:()=>{e.push("/settings"),N()},children:(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center mt-6",children:[(0,t.jsx)(n.DZ,{type:"h2",text:"Password changed successfully"}),(0,t.jsx)("p",{className:"text-12 text-black mt-2",children:"Your password has been changed successfully"}),(0,t.jsx)("span",{className:"mt-5 text-12",children:"You will now be redirected to login page"})]})})]})};var w=r(23555),h=r(80612),m=!0;function f(e){let{userDetails:s,suggestionList:r,tagsList:a}=e;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(h.A,{title:"Change Password"}),(0,t.jsx)(w.A,{userDetails:s,tagsList:a,suggestionList:r,children:(0,t.jsx)(x,{})})]})}},80612:(e,s,r)=>{"use strict";r.d(s,{A:()=>l});var t=r(37876),a=r(77328),n=r.n(a);function l(e){let{title:s}=e;return(0,t.jsx)(n(),{children:(0,t.jsx)("title",{children:s?"".concat(s," | Velaflow"):"Velaflow"})})}},82467:(e,s,r)=>
1{(window.__NEXT_P=window.__NEXT_P||[]).push(["/settings/change-password",function(){return r(51324)}])}},e=>{e.O(0,[9634,1408,3555,636,6593,8792],()=>e(e.s=82467)),_N_E=e.O()}]);

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.