"use strict";(self.webpackChunkmattermost_webapp=self.webpackChunkmattermost_webapp||[]).push([[7099],{47099:(e,s,t)=>{t.r(s),t.d(s,{default:()=>E});var a=t(37270),r=t(32446),o=t(17085),n=t(26614),m=(t(15724),t(5673),t(30164),t(21279),t(71633)),l=t.n(m),c=t(36418),u=t.n(c),d=t(14778),i=t(81911),p=t(14891),f=t(78451);const w=e=>{let{location:s,siteName:t,actions:a}=e;const r=(0,d.useIntl)(),o=(0,i.useHistory)(),[n,m]=(0,c.useState)(null),w=(0,c.useRef)(null);(0,c.useEffect)((()=>{document.title=r.formatMessage({id:"password_form.pageTitle",defaultMessage:"Password Reset | {siteName}"},{siteName:t||"Mattermost"})}),[r,t]);const g=n?u().createElement("div",{className:"form-group has-error"},u().createElement("label",{className:"control-label"},n)):null;return u().createElement("div",{className:"col-sm-12"},u().createElement("div",{className:"signup-team__container"},u().createElement(d.FormattedMessage,{id:"password_form.title",tagName:"h1",defaultMessage:"Password Reset"}),u().createElement("form",{onSubmit:async e=>{e.preventDefault();const t=w.current.value,r=new URLSearchParams(s.search).get("token");if("string"!=typeof r)throw new Error("token must be a string");const{data:n,error:l}=await a.resetUserPassword(r,t);n?(o.push("/login?extra="+f.Ay.PASSWORD_CHANGE),m(null)):l&&m(l.message)}},u().createElement("p",null,u().createElement(d.FormattedMessage,{id:"password_form.enter",defaultMessage:"Enter a new password for your {siteName} account.",values:{siteName:t}})),u().createElement("div",{className:l()("form-group",{"has-error":n})},u().createElement("input",{id:"resetPasswordInput",type:"password",className:"form-control",name:"password",ref:w,placeholder:r.formatMessage({id:"password_form.pwd",defaultMessage:"Password"}),spellCheck:"false",autoFocus:!0})),g,u().createElement(p.Button,{id:"resetPasswordButton",type:"submit",emphasis:"primary"},u().createElement(d.FormattedMessage,{id:"password_form.change",defaultMessage:"Change my password"})))))},g=(0,c.memo)(w),E=(0,a.connect)((function(e){return{siteName:(0,n.zj)(e).SiteName}}),(e=>({actions:(0,r.zH)({resetUserPassword:o.cw},e)})))(g)}}]);
//# sourceMappingURL=7099.da326eff2c831970f32b.js.map