PageSourceSearch

https://7bots.ai/assets/auth-_RXkhs5A.js

js 7bots.ai collected 2026-10-05 11:47:25 UTC 2,225 bytes, 1 lines download raw bytes

1import{u as y,r,s as l,j as e,t as n}from"./index-1ZTz6iih.js";import{b as j,S as v,B as N}from"./SiteHeader-DuMyyhju.js";import{L as x,I as f}from"./label-BCBhyQnD.js";function C(){const{t:s}=j(),i=y(),[o,p]=r.useState(""),[c,b]=r.useState(""),[u,d]=r.useState(!1),[m,h]=r.useState(!1);r.useEffect(()=>{l.auth.getSession().then(({data:t})=>{t.session&&i({to:"/admin"})})},[i]);const g=async()=>{if(!o){n.error("Enter your email above first, then click Forgot password.");return}h(!0);try{const{error:t}=await l.auth.resetPasswordForEmail(o,{redirectTo:`${window.location.origin}/reset-password`});if(t)throw t;n.success("Password reset email sent. Check your inbox.")}catch(t){n.error(t instanceof Error?t.message:"Could not send reset email")}finally{h(!1)}},w=async t=>{t.preventDefault(),d(!0);try{const{error:a}=await l.auth.signInWithPassword({email:o,password:c});if(a)throw a;i({to:"/admin"})}catch(a){n.error(a instanceof Error?a.message:"Authentication failed")}finally{d(!1)}};return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(v,{}),e.jsxs("main",{className:"mx-auto flex max-w-md flex-col px-4 py-16 sm:px-6",children:[e.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:s("auth.title")}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:s("auth.subtitle")}),e.jsxs("form",{onSubmit:w,className:"mt-6 space-y-4 rounded-2xl border border-border bg-card p-6 shadow-card",children:[e.jsxs("div",{children:[e.jsx(x,{className:"mb-1.5 block text-sm font-medium",children:s("auth.email")}),e.jsx(f,{type:"email",value:o,onChange:t=>p(t.target.value),required:!0,autoComplete:"email"})]}),e.jsxs("div",{children:[e.jsx(x,{className:"mb-1.5 block text-sm font-medium",children:s("auth.password")}),e.jsx(f,{type:"password",value:c,onChange:t=>b(t.target.value),required:!0,autoComplete:"current-password"})]}),e.jsx(N,{type:"submit",className:"w-full gradient-hero text-white",disabled:u,children:u?"...":s("auth.signIn")}),e.jsx("button",{type:"button",onClick:g,disabled:m,className:"block w-full text-center text-sm text-muted-foreground hover:text-foreground disabled:opacity-50",children:m?"Sending...":"Forgot password?"})]})]})]})}export{C 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.