import{a as e,k as a}from"./init-Ck7wRxmZ.js";import{R as t}from"./ResourceCard-CGnskTaT.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";let o=e({components:{ResourceCard:t},data(){return{error:null,success:!1,loading:!1,passwordData:{newUsername:"apollo",newPassword:"",confirmNewPassword:""}}},methods:{save(){if(this.passwordData.newPassword!==this.passwordData.confirmNewPassword){this.error="Password mismatch";return}this.error=null,this.loading=!0,fetch("./api/password",{headers:{"Content-Type":"application/json"},method:"POST",body:JSON.stringify(this.passwordData)}).then(s=>{this.loading=!1,s.status===200?s.json().then(r=>{this.success=r.status,this.success===!0?setTimeout(()=>{document.location.reload()},5e3):this.error=r.error}):this.error="Internal Server Error"})}}});a(o);
