2 lines
4.3 KiB
JavaScript
2 lines
4.3 KiB
JavaScript
"use strict";(self["webpackChunkmiriamgemeinde"]=self["webpackChunkmiriamgemeinde"]||[]).push([[423],{655:function(e,s,t){var o=t(6955),i=String;e.exports=function(e){if("Symbol"===o(e))throw new TypeError("Cannot convert a Symbol value to a string");return i(e)}},1423:function(e,s,t){t.r(s),t.d(s,{default:function(){return v}});var o=t(641),i=t(3751),a=t(33);const n=e=>((0,o.Qi)("data-v-e49a033c"),e=e(),(0,o.jt)(),e),r={class:"reset-password"},l=n((()=>(0,o.Lk)("h2",null,"Neues Passwort setzen",-1))),d=n((()=>(0,o.Lk)("label",{for:"password"},"Neues Passwort:",-1))),u=n((()=>(0,o.Lk)("label",{for:"confirmPassword"},"Passwort bestätigen:",-1))),h=["disabled"],c={key:0,class:"dialog"},g={class:"dialog-content"};function w(e,s,t,n,w,m){const p=(0,o.g2)("router-link");return(0,o.uX)(),(0,o.CE)("div",r,[l,(0,o.Lk)("form",{onSubmit:s[2]||(s[2]=(0,i.D$)(((...e)=>m.submitResetPassword&&m.submitResetPassword(...e)),["prevent"]))},[d,(0,o.bo)((0,o.Lk)("input",{type:"password",id:"password","onUpdate:modelValue":s[0]||(s[0]=e=>w.password=e),required:"",minlength:"6"},null,512),[[i.Jo,w.password]]),u,(0,o.bo)((0,o.Lk)("input",{type:"password",id:"confirmPassword","onUpdate:modelValue":s[1]||(s[1]=e=>w.confirmPassword=e),required:"",minlength:"6"},null,512),[[i.Jo,w.confirmPassword]]),(0,o.Lk)("button",{type:"submit",disabled:!m.isFormValid},"Passwort zurücksetzen",8,h)],32),(0,o.Lk)("p",null,[(0,o.bF)(p,{to:"/login"},{default:(0,o.k6)((()=>[(0,o.eW)("Zurück zum Login")])),_:1})]),w.dialogVisible?((0,o.uX)(),(0,o.CE)("div",c,[(0,o.Lk)("div",g,[(0,o.Lk)("h3",null,(0,a.v_)(w.dialogTitle),1),(0,o.Lk)("p",null,(0,a.v_)(w.dialogMessage),1),(0,o.Lk)("button",{type:"button",onClick:s[3]||(s[3]=(...e)=>m.closeDialog&&m.closeDialog(...e))},"Schließen")])])):(0,o.Q3)("",!0)])}t(4114),t(4603),t(7566),t(8721);var m=t(6296),p={name:"ResetPasswordComponent",data(){return{password:"",confirmPassword:"",token:"",dialogTitle:"",dialogMessage:"",dialogVisible:!1}},computed:{isFormValid(){return this.password.length>=6&&this.password===this.confirmPassword&&this.token}},mounted(){const e=new URLSearchParams(window.location.search);this.token=e.get("token"),this.token||this.showDialog("Fehler","Ungültiger Reset-Link. Bitte fordern Sie einen neuen Link an.")},methods:{async submitResetPassword(){if(this.password===this.confirmPassword)try{const e=await m.A.post("/auth/reset-password",{token:this.token,password:this.password});this.showDialog("Erfolg",e.data?.message||"Passwort erfolgreich zurückgesetzt. Sie können sich jetzt anmelden."),this.password="",this.confirmPassword="",setTimeout((()=>{this.$router.push("/auth/login")}),3e3)}catch(e){const s=e?.response?.data?.message||e?.message||"Ein unbekannter Fehler ist aufgetreten";this.showDialog("Fehler",s)}else this.showDialog("Fehler","Die Passwörter stimmen nicht überein.")},showDialog(e,s){this.dialogTitle=e,this.dialogMessage=s,this.dialogVisible=!0},closeDialog(){this.dialogVisible=!1}}},f=t(6262);const k=(0,f.A)(p,[["render",w],["__scopeId","data-v-e49a033c"]]);var v=k},2812:function(e){var s=TypeError;e.exports=function(e,t){if(e<t)throw new s("Not enough arguments");return e}},4603:function(e,s,t){var o=t(6840),i=t(9504),a=t(655),n=t(2812),r=URLSearchParams,l=r.prototype,d=i(l.append),u=i(l["delete"]),h=i(l.forEach),c=i([].push),g=new r("a=1&a=2&b=3");g["delete"]("a",1),g["delete"]("b",void 0),g+""!=="a=2"&&o(l,"delete",(function(e){var s=arguments.length,t=s<2?void 0:arguments[1];if(s&&void 0===t)return u(this,e);var o=[];h(this,(function(e,s){c(o,{key:s,value:e})})),n(s,1);var i,r=a(e),l=a(t),g=0,w=0,m=!1,p=o.length;while(g<p)i=o[g++],m||i.key===r?(m=!0,u(this,i.key)):w++;while(w<p)i=o[w++],i.key===r&&i.value===l||d(this,i.key,i.value)}),{enumerable:!0,unsafe:!0})},7566:function(e,s,t){var o=t(6840),i=t(9504),a=t(655),n=t(2812),r=URLSearchParams,l=r.prototype,d=i(l.getAll),u=i(l.has),h=new r("a=1");!h.has("a",2)&&h.has("a",void 0)||o(l,"has",(function(e){var s=arguments.length,t=s<2?void 0:arguments[1];if(s&&void 0===t)return u(this,e);var o=d(this,e);n(s,1);var i=a(t),r=0;while(r<o.length)if(o[r++]===i)return!0;return!1}),{enumerable:!0,unsafe:!0})},8721:function(e,s,t){var o=t(3724),i=t(9504),a=t(2106),n=URLSearchParams.prototype,r=i(n.forEach);o&&!("size"in n)&&a(n,"size",{get:function(){var e=0;return r(this,(function(){e++})),e},configurable:!0,enumerable:!0})}}]);
|
|
//# sourceMappingURL=423.b31eebf9.js.map
|