UNPKG

n8n-editor-ui

Version:

Workflow Editor UI for n8n

2 lines 3.69 kB
!function(){try{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"n8n@2.13.4"}}catch(e){}}(),System.register(["./vue.runtime.esm-bundler-legacy-IafOlCW8.js","./_MapCache-legacy-DwgdC8YO.js","./src-legacy-Dwzr7bD0.js","./sanitize-html-legacy-ChR3ikxn.js","./users.store-legacy-OKuN0qAC.js","./constants-legacy-DNCca_FT.js","./merge-legacy-uu1aGqHK.js","./_baseOrderBy-legacy-PsQY_Pvh.js","./dateformat-legacy-BxdD_OP7.js","./useDebounce-legacy-CT3oYGrC.js","./sso.store-legacy-VUs4UkgQ.js","./AuthView-legacy-D2ks9jRE.js"],(function(e,a){var t,s,n,r,o,u,d,i,l,c,f,w,g;return{setters:[function(e){t=e.$,s=e.Ft,n=e.N,r=e.T,o=e.X,u=e.w},function(e){d=e.bt},function(e){i=e._t},function(e){},function(e){l=e.Tr,c=e.t},function(e){e.Ol,f=e.ms},function(e){},function(e){},function(e){},function(e){},function(e){},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:{},(p=(new a.Error).stack)&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[p]="f054dd01-6b01-47a8-9ada-a22e51f48d95",a._sentryDebugIdIdentifier="sentry-dbid-f054dd01-6b01-47a8-9ada-a22e51f48d95")}catch(a){}var a,p;g=n({__name:"ChangePasswordView",setup(e){const n=c(),g=d(),p=l(),h=i(),y=s(""),b=s(!1),m=s(null),T=e=>"string"==typeof e&&e!==y.value&&{messageKey:"auth.changePassword.passwordsMustMatchError"},v=()=>h.currentRoute.value.query.token&&"string"==typeof h.currentRoute.value.query.token?h.currentRoute.value.query.token:null,P=async e=>{try{b.value=!0;const a=v();if(a){const t={token:a,password:y.value,...e.mfaCode&&{mfaCode:e.mfaCode}};await n.changePassword(t),p.showMessage({type:"success",title:g.baseText("auth.changePassword.passwordUpdated"),message:g.baseText("auth.changePassword.passwordUpdatedMessage")}),await h.push({name:f.SIGNIN})}else p.showError(new Error(g.baseText("auth.validation.missingParameters")),g.baseText("auth.changePassword.error"))}catch(a){p.showError(a,g.baseText("auth.changePassword.error"))}b.value=!1},x=e=>{"password"===e.name&&"string"==typeof e.value&&(y.value=e.value)};return o((async()=>{const e={title:g.baseText("auth.changePassword"),buttonText:g.baseText("auth.changePassword"),redirectText:g.baseText("auth.signin"),redirectLink:"/signin",inputs:[{name:"password",properties:{label:g.baseText("auth.newPassword"),type:"password",required:!0,validationRules:[{name:"DEFAULT_PASSWORD_RULES"}],infoText:g.baseText("auth.defaultPasswordRequirements"),autocomplete:"new-password",capitalize:!0}},{name:"password2",properties:{label:g.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();h.currentRoute.value.query.mfaEnabled&&"true"===h.currentRoute.value.query.mfaEnabled&&e.inputs.push({name:"mfaCode",initialValue:"",properties:{required:!0,label:g.baseText("mfa.code.input.label"),placeholder:g.baseText("mfa.code.input.placeholder"),maxlength:6,capitalize:!0,validateOnBlur:!0}}),m.value=e;try{if(!t)throw new Error(g.baseText("auth.changePassword.missingTokenError"));await n.validatePasswordToken({token:t})}catch(a){p.showError(a,g.baseText("auth.changePassword.tokenValidationError")),h.replace({name:f.SIGNIN})}})),(e,a)=>m.value?(t(),u(w,{key:0,form:m.value,"form-loading":b.value,onSubmit:P,onUpdate:x},null,8,["form","form-loading"])):r("",!0)}}),e("default",g)}}})); //# sourceMappingURL=ChangePasswordView-legacy-C8sTo8-W.js.map