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