PageSourceSearch

https://delaemd.com/assets/auth-CyScO-dq.js

js delaemd.com collected 2026-10-09 22:03:19 UTC 2,697 bytes, 1 lines download raw bytes

1import{u as p,r as i,s as c,j as e}from"./index-tFdxgtTe.js";function f(){const a=p(),[n,h]=i.useState("signin"),[o,x]=i.useState(""),[r,g]=i.useState(""),[d,l]=i.useState(null),[u,m]=i.useState(!1);i.useEffect(()=>{c.auth.getSession().then(({data:t})=>{t.session&&a({to:"/admin"})})},[a]);const w=async t=>{t.preventDefault(),m(!0),l(null);try{if(n==="signin"){const{error:s}=await c.auth.signInWithPassword({email:o,password:r});if(s)throw s;a({to:"/admin"})}else{const{error:s}=await c.auth.signUp({email:o,password:r,options:{emailRedirectTo:window.location.origin+"/auth"}});if(s)throw s;l("Check your email to confirm your account, then sign in.")}}catch(s){l(s.message)}finally{m(!1)}};return e.jsx("main",{className:"flex min-h-screen items-center justify-center bg-[oklch(0.11_0.015_265)] px-4",children:e.jsxs("div",{className:"w-full max-w-sm rounded-2xl border border-white/10 bg-white/[0.03] p-8 backdrop-blur-xl",children:[e.jsx("p",{className:"text-[10px] font-medium uppercase tracking-[0.24em] text-[oklch(0.85_0.08_205)]",children:"delaeMD Admin"}),e.jsx("h1",{className:"mt-2 text-xl font-semibold text-white",children:n==="signin"?"Sign in":"Create account"}),e.jsxs("form",{onSubmit:w,className:"mt-6 space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-white/80",htmlFor:"email",children:"Email"}),e.jsx("input",{id:"email",type:"email",required:!0,value:o,onChange:t=>x(t.target.value),className:"mt-2 block h-11 w-full rounded-lg border border-white/10 bg-white/[0.04] px-3 text-sm text-white placeholder:text-white/30 focus:border-white/30 focus:outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-white/80",htmlFor:"password",children:"Password"}),e.jsx("input",{id:"password",type:"password",required:!0,minLength:8,value:r,onChange:t=>g(t.target.value),className:"mt-2 block h-11 w-full rounded-lg border border-white/10 bg-white/[0.04] px-3 text-sm text-white focus:border-white/30 focus:outline-none"})]}),d&&e.jsx("p",{className:"text-xs text-white/70",children:d}),e.jsx("button",{type:"submit",disabled:u,className:"inline-flex h-11 w-full items-center justify-center rounded-md border border-[oklch(0.78_0.09_205)] bg-[oklch(0.78_0.09_205)] px-4 text-sm font-medium text-zinc-900 transition-all hover:bg-[oklch(0.82_0.09_205)] disabled:opacity-60",children:u?"…":n==="signin"?"Sign in":"Create account"})]}),e.jsx("button",{type:"button",onClick:()=>h(n==="signin"?"signup":"signin"),className:"mt-4 w-full text-xs text-white/50 hover:text-white",children:n==="signin"?"Need to create an account?":"Already have an account? Sign in"})]})})}export{f as component};

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.