PageSourceSearch

https://delphigrc.org/assets/Login-RE6KuT0X.js

js delphigrc.org collected 2026-10-04 00:26:49 UTC 2,312 bytes, 1 lines download raw bytes

1import{b as s,r as e,j as a}from"./vendor-react-BH6F5oQJ.js";import{C as r,M as t,N as i,O as n,m as l,G as o,f as c,s as d,D as m}from"./index-dRqPaCFl.js";import{L as p}from"./label-RVODh2pd.js";import{l as u}from"./validations-CCZ89lfg.js";import{G as j}from"./vendor-icons-CaI5__By.js";import"./vendor-ui-B4WC06Sp.js";import"./vendor-query-CC4VRGyP.js";import"./vendor-supabase-COwyE4EW.js";import"./slug-D4LuRHo0.js";import"./types-BnfuoFvn.js";const x=()=>{const x=s(),[h,f]=e.useState(""),[g,v]=e.useState(""),[y,w]=e.useState(!1);return a.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:a.jsxs(r,{className:"w-full max-w-md",children:[a.jsxs(t,{className:"space-y-1",children:[a.jsx("div",{className:"flex items-center justify-center mb-4",children:a.jsx(j,{className:"h-8 w-8 text-primary"})}),a.jsx(i,{className:"text-2xl text-center",children:"Admin Login"}),a.jsx(n,{className:"text-center",children:"Enter your credentials to access the admin panel"})]}),a.jsx(l,{children:a.jsxs("form",{onSubmit:async s=>{s.preventDefault(),w(!0);try{const s=u.safeParse({email:h,password:g});if(!s.success){const e=s.error.errors.map(s=>s.message).join(", ");throw new Error(e)}const{data:e,error:a}=await d.auth.signInWithPassword({email:s.data.email,password:s.data.password});if(a)throw a;m({title:"Success",description:"Logged in successfully"}),x("/admin")}catch(e){m({title:"Error",description:e.message||"Failed to log in",variant:"destructive"})}finally{w(!1)}},className:"space-y-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(p,{htmlFor:"email",children:"Email"}),a.jsx(o,{id:"email",type:"email",placeholder:"[email protected]",value:h,onChange:s=>f(s.target.value),required:!0})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(p,{htmlFor:"password",children:"Password"}),a.jsx(o,{id:"password",type:"password",placeholder:"Enter your password",value:g,onChange:s=>v(s.target.value),required:!0})]}),a.jsx(c,{type:"submit",className:"w-full",disabled:y,children:y?"Logging in...":"Log In"}),a.jsxs("div",{className:"text-center text-sm text-muted-foreground",children:["Don't have an account?"," ",a.jsx(c,{variant:"link",className:"p-0",onClick:()=>x("/admin/register"),children:"Register"})]})]})})]})})};export{x 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.