PageSourceSearch

https://www.ori-lane.com/assets/AdminAcceptInvite-BNeQakCz.js

js ori-lane.com collected 2026-10-10 00:07:44 UTC 3,081 bytes, 1 lines download raw bytes

1import{u as y,am as k,r as t,s as u,j as e,b7 as S,a as h,e as f,z as v,I as g,l as _,D as o}from"./index-h8K-9rNZ.js";function P(){const p=y(),[j]=k(),a=j.get("token")??"",[i,n]=t.useState("checking"),[r,b]=t.useState(null),[c,N]=t.useState(""),[d,m]=t.useState(!1);t.useEffect(()=>{if(!a){n("invalid");return}(async()=>{const{data:s,error:l}=await u.functions.invoke("admin-team-invite",{body:{action:"verify",token:a}});if(l||!(s!=null&&s.ok)){n("invalid");return}const x=s.invite;if(new Date(x.expires_at)<new Date){n("expired");return}b(x),n("valid")})()},[a]);const w=async s=>{if(s.preventDefault(),c.length<8){o.error("Password must be at least 8 characters");return}m(!0);const{error:l}=await u.functions.invoke("admin-team-invite",{body:{action:"accept",token:a,password:c}});if(m(!1),l){o.error(l.message);return}o.success("Account ready. Please sign in."),p("/admin/login",{replace:!0})};return e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-[hsl(25_30%_12%)] text-[hsl(35_25%_92%)] p-6",children:e.jsxs("div",{className:"w-full max-w-md",children:[e.jsxs("div",{className:"flex items-center justify-center gap-2 mb-8 font-serif text-2xl tracking-wide",children:[e.jsx(S,{className:"h-6 w-6 text-gold"}),"ORI",e.jsx("span",{className:"text-gold mx-1",children:"-"}),"LANE"]}),e.jsxs("div",{className:"bg-background text-foreground rounded-lg shadow-2xl p-8",children:[i==="checking"&&e.jsx("div",{className:"flex justify-center py-8",children:e.jsx(h,{className:"h-6 w-6 animate-spin text-gold"})}),i==="invalid"&&e.jsxs(e.Fragment,{children:[e.jsx("h1",{className:"text-xl font-serif font-light mb-2",children:"Invalid invite"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"This invite link is not valid. Please ask your administrator to send a new invite."}),e.jsx(f,{to:"/",className:"text-sm text-gold mt-4 inline-block",children:"Back to site"})]}),i==="expired"&&e.jsxs(e.Fragment,{children:[e.jsx("h1",{className:"text-xl font-serif font-light mb-2",children:"Invite link expired"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"This invite link has expired. Please contact your administrator to request a new invite."}),e.jsx(f,{to:"/",className:"text-sm text-gold mt-4 inline-block",children:"Back to site"})]}),i==="valid"&&r&&e.jsxs("form",{onSubmit:w,className:"space-y-4",children:[e.jsx("h1",{className:"text-xl font-serif font-light",children:"Set up your account"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Welcome, ",r.full_name??r.email,". Choose a password to finish setting up your access."]}),e.jsxs("div",{children:[e.jsx(v,{children:"Email"}),e.jsx(g,{value:r.email,readOnly:!0,disabled:!0})]}),e.jsxs("div",{children:[e.jsx(v,{children:"Password"}),e.jsx(g,{type:"password",required:!0,minLength:8,value:c,onChange:s=>N(s.target.value)})]}),e.jsxs(_,{type:"submit",className:"w-full bg-gold hover:bg-gold/90 text-[hsl(25_30%_12%)]",disabled:d,children:[d&&e.jsx(h,{className:"h-4 w-4 mr-2 animate-spin"}),"Activate account"]})]})]})]})})}export{P 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.