PageSourceSearch

https://www.velocityfrequentflyer.com/etc.clientlibs/my-velocity/c…ture-ChangePassword.75ce7f3eb7bc8774575f.js

js velocityfrequentflyer.com collected 2026-09-24 10:07:16 UTC 4,106 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkvff_my_velocity=self.webpackChunkvff_my_velocity||[]).push([[2643],{32188(s,e,r){r.r(e),r.d(e,{default:()=>B});var a=r(74848),o=r(96540),d=r(87501),n=r(92816),t=r(6899),i=r(2913),c=r(96758),l=r(69147),w=r(77023),h=r(53067),u=r(21137),p=r(84960),m=r(7641),f=r(47832),g=r(6816),C=r(49184),P=r(95516),j=r(7225),x=r(17911),A=r(38092),v=r(3848);var b=r(67308),_=r(38100),y=r(48578),F=r(47464);const S="newPassword",N="newPasswordConfirm",B=({errorMessages:s,ctaContainer:e})=>{const r=(0,x.A)(s=>s.user),[B,k]=(0,o.useState)(!1),[q,E]=(0,o.useState)(),[L,M]=(0,o.useState)(!1),R=(0,o.useRef)(null),T=(0,v.S_)(r),H=(0,v.ls)(r),W=(0,v.R$)(r),D=(0,d.mN)(F.L),{handleSubmit:I,watch:J,trigger:V,formState:{touchedFields:$}}=D,[O,U]=J([S,N]);(0,o.useEffect)(()=>{L&&R.current&&(0,A.Io)(R)},[L]);const Y=(0,o.useCallback)(async e=>{const r={data:{action:"UPDATE",newPassword:e.newPassword,currentPassword:e.currentPassword}};try{k(!1),M(!1);const s=(0,i._)(r);await c.A.vffV2ApiWithMfa.patch("/loyalty/v2/password",s),await l.Ay.logout(`${window.location.origin}/change-password-success`)}catch(e){const r=e;if((0,A.cl)(r))await l.Ay.initMfaFlow(null,"changePassword");else{M(!0);const e=(0,A.rC)(r,s);E(e)}}},[]),{isMfaPending:z}=(0,j.A)(T,"changePassword");return(0,a.jsx)(w.A,{section:n.E.changePassword,children:(0,a.jsxs)("div",{className:"src-features-ChangePassword-ChangePassword_container",children:[(!T&&!H&&W||z)&&(0,a.jsx)("div",{className:"src-features-ChangePassword-ChangePassword_loadingContainer",children:(0,a.jsx)(C.A,{})}),T&&!z&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(m.A,{theme:"typeB",children:L&&(0,a.jsx)(P.A,{theme:"error",ref:R,description:null==q?void 0:q.description})}),!B&&(0,a.jsx)("div",{className:"src-features-ChangePassword-ChangePassword_formWrapper",children:(0,a.jsx)(d.Op,{...D,children:(0,a.jsx)(t.A,{children:(0,a.jsx)(h.A,{type:"typeB",children:(0,a.jsxs)("form",{onSubmit:I(Y),"aria-label":"Change Password Form",children:[(0,a.jsx)(p.A,{children:(0,a.jsx)(u.A,{className:"src-features-ChangePassword-ChangePassword_currentField",children:(0,a.jsx)(b.A,{name:"currentPassword",label:"Current password",rules:{required:"Current password is required"},placeholder:"Enter password",autoComplete:"current-password",hideToggle:!0})})}),(0,a.jsxs)(p.A,{children:[(0,a.jsxs)("div",{className:"src-features-ChangePassword-ChangePassword_FormFieldContainerWrapper",children:[(0,a.jsx)(u.A,{type:"largeRow",children:(0,a.jsx)(b.A,{name:S,label:"New password",rules:{required:"Password is required",validate:{password:s=>(0,g.wJ)()(s),matchesField:(s,e)=>!$[N]||s===e[N]||"The password you have entered does not match"}},placeholder:"Enter password","aria-describedby":"password_validator_sr_description",autoComplete:"new-password",onChange:()=>{$[N]&&V(N)},ariaLabelForHideButton:"Hide password for new password",ariaLabelForShowButton:"Show password for new password"})}),(0,a.jsx)(u.A,{type:"largeRow",children:(0,a.jsx)(b.A,{name:N,label:"Confirm New password",rules:{required:"A password confirmation is required",validate:{password:s=>(0,g.wJ)()(s),matchesField:(s,e)=>s===e[S]||"The password you have entered does not match"}},placeholder:"Re-enter password",autoComplete:"confirm-password",onChange:()=>{$[S]&&V(S)},ariaLabelForHideButton:"Hide password for confirm password",ariaLabelForShowButton:"Show password for confirm password"})})]}),(0,a.jsx)(f.A,{className:"src-features-ChangePassword-ChangePassword_passwordValidator",title:"Your new password must include",currentPassword:O,newPasswordConfirm:U,screenReaderDescriptionContainerId:"password_validator_sr_description",arePasswordsMatchErrorMessage:$[S]&&$[N]&&O!==U?"The passwords you have entered do not match":""})]}),(0,a.jsx)(_.A,{stealth:!0}),(0,a.jsx)("div",{className:"src-features-ChangePassword-ChangePassword_submitWrapper",children:(0,a.jsx)(y.A,{className:"src-features-ChangePassword-ChangePassword_submitButton","aria-label":"Click here to Submit new password",children:(0,a.jsx)("span",{children:(null==e?void 0:e.ctaLabel)||"Submit"})})})]})})})})})]})]})})}}}]);

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.