PageSourceSearch

https://pdap.io/assets/reset-password-C_Yk9Pod.js

js pdap.io collected 2026-10-04 00:24:59 UTC 3,481 bytes, 1 lines download raw bytes

1import{R as a,aa as s,bb as e,a0 as r,S as o,be as t,o as l,c as d,b as u,u as i,d as n,e as p,w as m,aW as c,K as w,F as f,f as v,ab as x,m as g,Q as h,ac as y,J as _,D as b,E as P,bf as k,bc as C}from"./index-CcZ45_S5.js";import{P as j}from"./PasswordValidationChecker-B--Z2wuE.js";import{u as q}from"./useMutation-Ca8CgNX9.js";import{T as S}from"./test-ids-C_9vcHPk.js";import"./index.es-0vjt-INv.js";import"./index-BA8Bn5Lq.js";import"./_plugin-vue_export-helper-BCo6x5W8.js";import"./useQueryClient-D_RWsVuD.js";const V={key:0,class:"flex flex-col items-start sm:gap-4"},D=["data-test"],E={__name:"reset-password",setup(E){const F=[{autocomplete:"password","data-test":S.password_input,id:"password",name:"password",label:"Password",placeholder:"Your updated password"},{autocomplete:"password","data-test":S.confirm_password_input,id:"confirmPassword",name:"confirmPassword",label:"Confirm Password",placeholder:"Confirm your updated password"}],L=[{name:"password",label:"Password",validators:{required:{value:!0},password:{message:"Please provide your password",value:!0}}},{name:"confirmPassword",validators:{required:{value:!0},password:{message:"Please confirm your password",value:!0}}}],T=a(),J=s(),Q=T.query.token,R=e(),z=r(),{error:I,isSuccess:K,isLoading:M,status:W,mutate:Y}=q({mutationFn:async a=>async function(a){var s;const e=null==(s=A.value)?void 0:s.isPasswordValid();e?H.value&&(H.value=void 0):H.value="Password is not valid";if(!U(a)||!e)return;const{password:r}=a;await k(r,Q),await C(t(Q).sub.user_email,r),J.push(z.redirectTo??{path:"profile"})}(a),onError:a=>{"The submitted token is invalid"===a.message&&(B.value=!0)},onSuccess:()=>{P.success("Password updated successfully")}}),A=b(),B=b(!1),G=b(!1),H=b(!1);function N(a){var s;null==(s=A.value)||s.updatePasswordValidation(a.password),H.value&&U(a)}function O(a){var s;"password"===a.target.name&&(null==(s=A.value)||s.updatePasswordValidation(a.target.value))}function U(a){return a.password!==a.confirmPassword?(H.value||(H.value="Passwords do not match, please try again."),!1):(H.value=void 0,!0)}return o(async function(){if(!Q)return void J.replace({path:"/request-reset-password"});const a=t(Q);R.setEmail(a.sub.user_email),a.exp<Date.now()/1e3&&(B.value=!0);G.value=!0}),(a,s)=>{var e;return l(),d("main",{class:_(["pdap-flex-container",{"mx-auto max-w-2xl":!i(K)}])},[s[4]||(s[4]=u("h1",null,"Change your password",-1)),G.value?G.value&&B.value?(l(),d("p",{key:1,"data-test":i(S).token_expired,class:"flex flex-col items-start sm:gap-4"},[s[2]||(s[2]=n(" Sorry, that token has expired. ",-1)),p(i(c),{"data-test":i(S).re_request_link,to:"/request-reset-password",onClick:s[0]||(s[0]=a=>{B.value=!1,I.value=void 0,Q.value=void 0})},{default:m(()=>[...s[1]||(s[1]=[n(" Click here to request another ",-1)])]),_:1},8,["data-test"])],8,D)):(l(),w(i(y),{key:2,id:"reset-password","data-test":"reset-password-form",class:"flex flex-col gap-2",name:"reset-password",error:(null==(e=i(I))?void 0:e.message)??H.value,schema:L,onChange:N,onSubmit:i(Y),onInput:O},{default:m(()=>[(l(),d(f,null,v(F,a=>p(i(x),g({ref_for:!0},{...a},{key:a.name}),null,16)),64)),p(j,{ref_key:"passwordRef",ref:A},null,512),p(i(h),{class:"max-w-full","data-test":i(S).form_submit,"is-loading":i(M)||"pending"===i(W),type:"submit"},{default:m(()=>[...s[3]||(s[3]=[n(" Change password ",-1)])]),_:1},8,["data-test","is-loading"])]),_:1},8,["error","onSubmit"])):(l(),d("p",V," Loading... "))],2)}}};export{E 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.