PageSourceSearch

https://plans.choiceplan.co.uk/_next/static/chunks/pages/complete-account-2ba6351e32b0625a.js

js choiceplan.co.uk collected 2026-10-07 22:46:47 UTC 2,170 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8921],{2385:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/complete-account",function(){return r(3154)}])},3154:function(e,t,r){"use strict";r.r(t);var o=r(5893),a=r(7294),n=r(1163),s=r(3299),i=r(7536),c=r(3667),u=r(572),l=r(6158),d=r(5895),p=r(2088),f=r(8024),w=r(6196),y=r(2924);t.default=()=>{let e=(0,n.useRouter)(),{control:t,watch:r,resetField:m}=(0,i.Gc)(),{setAppEmail:h,setAppPassword:_}=(0,y.SE)(),[x,g]=(0,a.useState)(!1),[j,b]=(0,a.useState)(""),E=r("options.password"),N=(0,f.pR)(["options.password","options.passwordconfirm"]),S="string"==typeof e.query.email?e.query.email.replace(/ /g,"+"):"",k=async()=>{if(b(""),!N()||!E||!S){S||b("We could not identify the email address for this account.");return}g(!0);try{let t=await fetch("/api/wp/user/complete-account",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:E})});if(!t.ok)throw Error("Unable to set account password");let r=await (0,w.Hz)(S,E);if(200!==r)throw Error("Unable to send verification code");h(S),_(E),m("options.password"),await (0,s.signOut)({redirect:!1}),await e.push({pathname:"/journey/validate",query:{type:"account",..."string"==typeof e.query.returnUrl?{returnUrl:e.query.returnUrl}:{}}})}catch(e){console.error("Account completion failed",e),b("We could not complete your account. Please try again."),g(!1)}};return(0,o.jsxs)(c.Z,{title:"Set your password",children:[(0,o.jsx)(u.Z,{title:"Set a password to secure your account",copy:"You can set a password to secure your account, and log in faster next time."}),(0,o.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,o.jsx)(i.Qr,{control:t,name:"options.password",render:e=>{let{field:{name:t,onChange:r},fieldState:{error:a}}=e;return(0,o.jsx)(l.Z,{label:"Your Password",id:t,onValueUpdate:r,initialError:null==a?void 0:a.message})}}),j&&(0,o.jsx)(p.Z,{error:j}),(0,o.jsx)("div",{className:"pt-5 mt-10 border-t border-tertiary",children:(0,o.jsx)(d.Z,{label:"Proceed to email confirmation",loading:x,onClick:k})})]})]})}}},function(e){e.O(0,[3796,9774,2888,179],function(){return e(e.s=2385)}),_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.