PageSourceSearch

https://footballkenya.org/assets/SPLTeamLogin-BHRXy9xt.js

js footballkenya.org collected 2026-09-24 18:41:30 UTC 2,924 bytes, 1 lines download raw bytes

1import{j as e}from"./query-vendor-DVQaV_Rn.js";import{d as w,r as i,L as j}from"./react-vendor-Dg4UHVsA.js";import{u as v,H as b,l as N,m as L,aG as y,n as C,y as P,o as S,B as E,F as q,s as t}from"./index-CkxFmtyJ.js";import{I as u}from"./input-CYC3ppva.js";import{L as h}from"./label-BjAlshPg.js";import{L as D}from"./loader-circle-BVYktK8M.js";import{L as I}from"./log-in-DLiyhW2p.js";import"./supabase-vendor-sRrgOpWC.js";function R(){const x=w(),{toast:r}=v(),[n,p]=i.useState(""),[o,g]=i.useState(""),[l,c]=i.useState(!1),f=async a=>{a.preventDefault(),c(!0);try{const{error:s}=await t.auth.signInWithPassword({email:n,password:o});if(s)throw s;const{data:{user:d}}=await t.auth.getUser();if(!d)throw new Error("Auth failed");const{data:m}=await t.from("spl_team_accounts").select("id, status, team_id").eq("user_id",d.id).maybeSingle();if(!m){await t.auth.signOut(),r({title:"Access Denied",description:"No team account found for this email",variant:"destructive"});return}if(m.status!=="approved"){await t.auth.signOut(),r({title:"Pending Approval",description:"Your team account is awaiting admin approval",variant:"destructive"});return}x("/spl-team/dashboard")}catch(s){r({title:"Login Failed",description:s.message,variant:"destructive"})}finally{c(!1)}};return e.jsxs("div",{className:"min-h-screen flex flex-col bg-[#0a1628]",children:[e.jsx(b,{}),e.jsx("main",{className:"flex-1 pt-24 pb-12 flex items-center justify-center",children:e.jsxs(N,{className:"w-full max-w-md mx-4 bg-white/10 backdrop-blur-sm border-white/20",children:[e.jsxs(L,{className:"text-center",children:[e.jsx("div",{className:"flex justify-center mb-4",children:e.jsx("img",{src:y,alt:"SPL",className:"h-16 w-16 rounded-full border-2 border-green-500"})}),e.jsx(C,{className:"text-white text-2xl flex items-center justify-center gap-2",children:"Team Portal"}),e.jsx(P,{className:"text-white/60",children:"Login to manage your squad & view fixtures"})]}),e.jsxs(S,{children:[e.jsxs("form",{onSubmit:f,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(h,{className:"text-white/80",children:"Email"}),e.jsx(u,{type:"email",value:n,onChange:a=>p(a.target.value),required:!0,className:"bg-white/10 border-white/20 text-white",placeholder:"[email protected]"})]}),e.jsxs("div",{children:[e.jsx(h,{className:"text-white/80",children:"Password"}),e.jsx(u,{type:"password",value:o,onChange:a=>g(a.target.value),required:!0,className:"bg-white/10 border-white/20 text-white"})]}),e.jsxs(E,{type:"submit",disabled:l,className:"w-full bg-green-600 hover:bg-green-500",children:[l?e.jsx(D,{className:"h-4 w-4 animate-spin mr-2"}):e.jsx(I,{className:"h-4 w-4 mr-2"}),"Login"]})]}),e.jsxs("p",{className:"text-center mt-4 text-white/50 text-sm",children:["Don't have an account?"," ",e.jsx(j,{to:"/sportpesa-league",className:"text-green-400 hover:underline",children:"Register on SPL page"})]})]})]})}),e.jsx(q,{})]})}export{R 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.