1import{r as u,o as a,c as l,a as t,d as g,w as c,v as m,t as r,b as _,h as p,f,g as b}from"./vue-router-Cc0Ijf1R.js";import{_ as w}from"./_plugin-vue_export-helper-DlAUqK2U.js";const k={data(){return{email:"",password:"",errorMessage:"",loading:!1}},methods:{getCookie(e){const s=document.cookie.match(new RegExp("(^| )"+e+"=([^;]+)"));return s?decodeURIComponent(s[2]):null},async submit(){this.errorMessage="",this.loading=!0;try{const e=await fetch("/login",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","X-XSRF-TOKEN":this.getCookie("XSRF-TOKEN")},body:JSON.stringify({email:this.email,password:this.password}),credentials:"same-origin",redirect:"manual"});if(e.type==="opaqueredirect"||e.status===302){window.location.href=this.$path("home");return}if(e.status===422){const s=await e.json(),i=s==null?void 0:s.errors;this.errorMessage=i?i[Object.keys(i)[0]][0]:this.$t("invalidCredentials")}else this.errorMessage=this.$t("somethingWentWrong")}catch{this.errorMessage=this.$t("somethingWentWrong")}this.loading=!1}}},v={class:"electron-login-screen"},y={class:"electron-login-card"},M={class:"mb-3"},C=["placeholder"],N={class:"mb-3"},T=["placeholder"],$={key:0,class:"text-danger small mb-3"},S=["disabled"],V={key:0},x={key:1},E={class:"mt-3 text-center"},O={href:"/forgot-password",target:"_blank",class:"text-muted small"},j={class:"mt-2 text-center small"},I={class:"text-muted"},R={href:"/register",target:"_blank"},U={class:"mt-2 text-center"};function W(e,s,i,q,o,d){const h=u("router-link");return a(),l("div",v,[t("div",y,[t("form",{onSubmit:s[2]||(s[2]=g((...n)=>d.submit&&d.submit(...n),["prevent"]))},[t("div",M,[c(t("input",{"onUpdate:modelValue":s[0]||(s[0]=n=>o.email=n),type:"email",class:"form-control",placeholder:e.$t("email"),required:"",autofocus:""},null,8,C),[[m,o.email]])]),t("div",N,[c(t("input",{"onUpdate:modelValue":s[1]||(s[1]=n=>o.password=n),type:"password",class:"form-control",placeholder:e.$t("password"),required:""},null,8,T),[[m,o.password]])]),o.errorMessage?(a(),l("div",$,r(o.errorMessage),1)):_("",!0),t("button",{type:"submit",class:"btn btn-dark w-100",disabled:o.loading},[o.loading?(a(),l("span",V,r(e.$t("signingIn")),1)):(a(),l("span",x,r(e.$t("signIn")),1))],8,S)],32),t("div",E,[t("a",O,r(e.$t("forgotPassword")),1)]),t("div",j,[t("span",I,r(e.$t("noAccount")),1),s[3]||(s[3]=p()),t("a",R,r(e.$t("signUp")),1)]),t("div",U,[f(h,{to:e.$path("home"),class:"text-muted small"},{default:b(()=>[p(r(e.$t("backToHome")),1)]),_:1},8,["to"])])])])}const A=w(k,[["render",W],["__scopeId","data-v-b3fd63a2"]]);export{A as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.