PageSourceSearch

https://aviumui.org/assets/entries/src_pages_admin_login.yJZvt7lR.js

js aviumui.org collected 2026-09-25 22:37:27 UTC 4,377 bytes, 1 lines download raw bytes

1import{_ as m,r as c,f,b as t,N as y,L as r,G as n,z as v,v as h,w,C as S,t as g,u as l,l as T,k as P,s as b}from"../chunks/chunk-D6Oav43O.js";import{n as d}from"../chunks/chunk-lzWkO0SH.js";import"../chunks/chunk-D1JYe4Qp.js";/* empty css                      *//* empty css                      *//* empty css                      *//* empty css                      */import"../chunks/chunk-BwNI8fUT.js";const z={class:"admin-auth"},_={class:"md3-card auth-card"},A={class:"field"},U={class:"field"},k=["disabled"],x={__name:"+Page",setup(j){S();const a=h({email:"",password:""}),s=w(!1);c(()=>{try{const e=new URL(window.location.href).searchParams.get("email");e&&(a.email=e)}catch{}});async function p(){if(!a.email){await l({type:"alert",title:"Validation",content:"Please enter email."});return}s.value=!0;try{const o=await fetch("/api/user/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:a.email,password:a.password||void 0})}),e=await o.json().catch(()=>({}));if(!o.ok){if(o.status===403){await l({type:"alert",title:"Password Not Set",content:"Please set your password first."}),await d(`/admin/set-password?email=${encodeURIComponent(a.email)}`);return}const u=e?.data?.error||e?.message||"Login failed";throw new Error(u)}const i=e?.data?.tokens;i?.accessToken&&i?.refreshToken&&(localStorage.setItem("accessToken",i.accessToken),localStorage.setItem("refreshToken",i.refreshToken)),await l({type:"alert",title:"Success",content:"Signed in successfully."}),await d("/admin")}catch(o){await l({type:"alert",title:"Login Error",content:String(o?.message||o)})}finally{s.value=!1}}return(o,e)=>
1(g(),f("div",z,[t("div",_,[e[5]||(e[5]=t("h1",null,"Admin Login",-1)),t("form",{onSubmit:y(p,["prevent"]),class:"form"},[t("label",A,[e[2]||(e[2]=t("span",{class:"label"},"Email",-1)),r(t("input",{class:"md3-input","onUpdate:modelValue":e[0]||(e[0]=i=>a.email=i),type:"email",autocomplete:"email",placeholder:"[email protected]"},null,512),[[n,a.email,void 0,{trim:!0}]])]),t("label",U,[e[3]||(e[3]=t("span",{class:"label"},"Password",-1)),r(t("input",{class:"md3-input","onUpdate:modelValue":e[1]||(e[1]=i=>a.password=i),type:"password",autocomplete:"current-password",placeholder:"Enter password"},null,512),[[n,a.password]])]),t("button",{class:"md3-btn md3-btn--filled",type:"submit",disabled:s.value},v(s.value?"Signing in…":"Sign In"),9,k),e[4]||(e[4]=t("div",{class:"hint"}," If you haven’t set a password yet, you’ll be redirected to the set password page after submitting your email. ",-1))],32)])]))}},D=m(x,[["__scopeId","data-v-5ed85040"]]),E=Object.freeze(Object.defineProperty({__proto__:null,default:D},Symbol.toStringTag,{value:"Module"})),N={hasServerOnlyHook:{type:"computed",definedAtData:null,valueSerialized:{type:"js-serialized",value:!1}},isClientRuntimeLoaded:{type:"computed",definedAtData:null,valueSerialized:{type:"js-serialized",value:!0}},onBeforeRenderEnv:{type:"computed",definedAtData:null,valueSerialized:{type:"js-serialized",value:null}},dataEnv:{type:"computed",definedAtData:null,valueSerialized:{type:"js-serialized",value:null}},guardEnv:{type:"computed",definedAtData:null,valueSerialized:{type:"js-serialized",value:null}},onRenderClient:{type:"standard",definedAtData:{filePathToShowToUser:"vike-vue/__internal/integration/onRenderClient",fileExportPathToShowToUser:[]},valueSerialized:{type:"pointer-import",value:b}},Page:{type:"standard",definedAtData:{filePathToShowToUser:"/src/pages/admin/login/+Page.vue",fileExportPathToShowToUser:[]},valueSerialized:{type:"plus-file",exportValues:E}},hydrationCanBeAborted:{type:"standard",definedAtData:{filePathToShowToUser:"vike-vue/config",fileExportPathToShowToUser:["default","hydrationCanBeAborted"]},valueSerialized:{type:"js-serialized",value:!0}},Layout:{type:"cumulative",definedAtData:[{filePathToShowToUser:"/src/pages/+Layout.vue",fileExportPathToShowToUser:[]}],valueSerialized:[{type:"plus-file",exportValues:P}]},title:{type:"standard",definedAtData:{filePathToShowToUser:"/src/pages/+config.js",fileExportPathToShowToUser:["default","title"]},valueSerialized:{type:"js-serialized",value:"AviumUI"}},onCreateApp:{type:"cumulative",definedAtData:[{filePathToShowToUser:"/src/pages/+onCreateApp.js",fileExportPathToShowToUser:[]}],valueSerialized:[{type:"plus-file",exportValues:T}]}};export{N as configValuesSerialized};

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.