n8n-editor-ui
Version:
Workflow Editor UI for n8n
2 lines • 3.39 kB
JavaScript
!function(){try{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"n8n@2.16.1"}}catch(e){}}(),System.register(["./vue.runtime.esm-bundler-legacy-BW6xDdqj.js","./core-legacy-VD8c7QJ-.js","./src-legacy-B67uuxhB.js","./users.store-legacy-azRUgFdP.js","./constants-legacy-2_ytuuS3.js","./AuthView-legacy-Wj84asB_.js"],(function(e,a){var t,s,r,n,o,u,d,i,l,c,f,w,p;return{setters:[function(e){t=e.$,s=e.Ft,r=e.N,n=e.T,o=e.X,u=e.w},function(e){d=e.at},function(e){i=e.lt},function(e){l=e.Pn,c=e.t},function(e){f=e.Qo},function(e){w=e.t}],execute:function(){try{a="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},(h=(new a.Error).stack)&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[h]="d13bba8c-37f3-4d72-a3ec-cf2a427783ff",a._sentryDebugIdIdentifier="sentry-dbid-d13bba8c-37f3-4d72-a3ec-cf2a427783ff")}catch(a){}var a,h;p=r({__name:"ChangePasswordView",setup(e){const r=c(),p=d(),h=l(),g=i(),b=s(""),y=s(!1),m=s(null),T=e=>"string"==typeof e&&e!==b.value&&{messageKey:"auth.changePassword.passwordsMustMatchError"},v=()=>g.currentRoute.value.query.token&&"string"==typeof g.currentRoute.value.query.token?g.currentRoute.value.query.token:null,P=async e=>{try{y.value=!0;const a=v();if(a){const t={token:a,password:b.value,...e.mfaCode&&{mfaCode:e.mfaCode}};await r.changePassword(t),h.showMessage({type:"success",title:p.baseText("auth.changePassword.passwordUpdated"),message:p.baseText("auth.changePassword.passwordUpdatedMessage")}),await g.push({name:f.SIGNIN})}else h.showError(new Error(p.baseText("auth.validation.missingParameters")),p.baseText("auth.changePassword.error"))}catch(a){h.showError(a,p.baseText("auth.changePassword.error"))}y.value=!1},x=e=>{"password"===e.name&&"string"==typeof e.value&&(b.value=e.value)};return o((async()=>{const e={title:p.baseText("auth.changePassword"),buttonText:p.baseText("auth.changePassword"),redirectText:p.baseText("auth.signin"),redirectLink:"/signin",inputs:[{name:"password",properties:{label:p.baseText("auth.newPassword"),type:"password",required:!0,validationRules:[{name:"DEFAULT_PASSWORD_RULES"}],infoText:p.baseText("auth.defaultPasswordRequirements"),autocomplete:"new-password",capitalize:!0}},{name:"password2",properties:{label:p.baseText("auth.changePassword.reenterNewPassword"),type:"password",required:!0,validators:{TWO_PASSWORDS_MATCH:{validate:T}},validationRules:[{name:"TWO_PASSWORDS_MATCH"}],autocomplete:"new-password",capitalize:!0}}]},t=v();g.currentRoute.value.query.mfaEnabled&&"true"===g.currentRoute.value.query.mfaEnabled&&e.inputs.push({name:"mfaCode",initialValue:"",properties:{required:!0,label:p.baseText("mfa.code.input.label"),placeholder:p.baseText("mfa.code.input.placeholder"),maxlength:6,capitalize:!0,validateOnBlur:!0}}),m.value=e;try{if(!t)throw new Error(p.baseText("auth.changePassword.missingTokenError"));await r.validatePasswordToken({token:t})}catch(a){h.showError(a,p.baseText("auth.changePassword.tokenValidationError")),g.replace({name:f.SIGNIN})}})),(e,a)=>m.value?(t(),u(w,{key:0,form:m.value,"form-loading":y.value,onSubmit:P,onUpdate:x},null,8,["form","form-loading"])):n("",!0)}}),e("default",p)}}}));
//# sourceMappingURL=ChangePasswordView-legacy-BicK1G-B.js.map