PageSourceSearch

https://caimpare.ai/_nuxt/C5tdMwwF.js

js caimpare.ai collected 2026-10-05 13:09:50 UTC 3,404 bytes, 1 lines download raw bytes

1import{f as h,P as _,E as L,o as r,c as i,a as t,y as k,m,x as p,b as f,w,d,e as N,t as S,k as T,s as u,J as V,p as g}from"./g7eelCOP.js";const A={class:"flex-grow flex items-center justify-center bg-slate-950 p-4"},P={class:"w-full max-w-md space-y-8"},D={class:"bg-slate-950 rounded-lg border border-white/10 shadow-xl shadow-slate-950/25 p-8"},I={class:"flex items-center justify-between"},M={class:"text-sm"},U={key:0,class:"text-rose-300 text-sm"},j=["disabled"],q={key:0},B={key:1},E={class:"text-center text-sm text-slate-400"},F={__name:"login",setup(C){h({title:"Log in",description:"Log in to your cAImpare account to manage tools, reviews, and saved favorites.",ogTitle:"Log in",ogDescription:"Log in to your cAImpare account to manage tools, reviews, and saved favorites.",twitterTitle:"Log in",twitterDescription:"Log in to your cAImpare account to manage tools, reviews, and saved favorites."});const s=V({username:"",password:""}),o=g(!1),a=g(""),{fetchUser:y,isAdmin:x}=_(),b=L();async function v(){o.value=!0,a.value="";const n=new URLSearchParams;n.append("username",s.username),n.append("password",s.password);try{await $fetch("/api/auth/login",{method:"POST",body:n,credentials:"include"}),await y();const e=b.query.redirect;e&&typeof e=="string"?await u(e):x.value?await u("/admin/dashboard"):await u("/dashboard")}catch{a.value="Invalid email or password."}finally{o.value=!1}}return(n,e)=>{const c=N;return r(),i("div",A,[t("div",P,[t("div",D,[e[5]||(e[5]=t("h1",{class:"text-2xl font-bold text-center mb-6"},"Log in to your account",-1)),t("form",{onSubmit:k(v,["prevent"]),class:"space-y-6"},[t("div",null,[e[2]||(e[2]=t("label",{for:"username",class:"block text-sm font-medium text-slate-300"},"Email",-1)),m(t("input",{id:"username","onUpdate:modelValue":e[0]||(e[0]=l=>s.username=l),type:"email",required:"",class:"mt-1 block w-full px-3 py-2 border border-white/10 rounded-md shadow-sm focus:outline-none focus:ring-2 bg-slate-900 text-white placeholder-slate-500 focus:ring-cyan-300/30 focus:border-cyan-300",placeholder:"[email protected]"},null,512),[[p,s.username]])]),t("div",null,[t("div",I,[e[4]||(e[4]=t("label",{for:"password",class:"block text-sm font-medium text-slate-300"},"Password",-1)),t("div",M,[f(c,{to:"/forgot-password",class:"font-medium text-cyan-200 hover:text-cyan-100"},{default:w(()=>[...e[3]||(e[3]=[d(" Forgot your password? ",-1)])]),_:1})])]),m(t("input",{id:"password","onUpdate:modelValue":e[1]||(e[1]=l=>s.password=l),type:"password",required:"",class:"mt-1 block w-full px-3 py-2 border border-white/10 rounded-md shadow-sm focus:outline-none focus:ring-2 bg-slate-900 text-white placeholder-slate-500 focus:ring-cyan-300/30 focus:border-cyan-300"},null,512),[[p,s.password]])]),a.value?(r(),i("div",U,S(a.value),1)):T("",!0),t("button",{type:"submit",disabled:o.value,class:"w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-slate-950 bg-cyan-300 hover:bg-cyan-200 focus:outline-none focus:ring-2 focus:ring-offset-2 bg-slate-900 text-white placeholder-slate-500 focus:ring-cyan-300/30 disabled:opacity-50"},[o.value?(r(),i("span",q,"Logging in...")):(r(),i("span",B,"Login"))],8,j)],32)]),t("p",E,[e[7]||(e[7]=d(" Need an account? ",-1)),f(c,{to:"/register",class:"font-medium text-cyan-200 hover:text-cyan-100"},{default:w(()=>[...e[6]||(e[6]=[d("Sign up",-1)])]),_:1})])])])}}};export{F 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.