PageSourceSearch

https://tqf.app/assets/auth-D9hC79vg.js

js tqf.app collected 2026-10-10 02:21:33 UTC 3,046 bytes, 1 lines download raw bytes

1import{u as h,a as j,r as a,s as u,j as e}from"./index-BDj_Oqhy.js";import{N as w}from"./SiteHeader-DpGzkoBE.js";function k(){const n=h(),p=j(),[o,g]=a.useState("signin"),[r,x]=a.useState(""),[i,f]=a.useState(""),[l,c]=a.useState(!1),[m,d]=a.useState(null);a.useEffect(()=>{u.auth.getSession().then(({data:s})=>{s.session&&n({to:"/panel"})})},[n]);async function b(s){s.preventDefault(),c(!0),d(null);try{if(o==="signup"){const{error:t}=await u.auth.signUp({email:r,password:i,options:{emailRedirectTo:window.location.origin+"/panel"}});if(t)throw t}else{const{error:t}=await u.auth.signInWithPassword({email:r,password:i});if(t)throw t}await p.invalidate(),n({to:"/panel"})}catch(t){d(t instanceof Error?`Sprawdź dane i spróbuj ponownie — po poprawnym logowaniu przejdziesz do panelu. (${t.message})`:"Sprawdź adres e-mail i hasło, a następnie potwierdź ponownie, aby uzyskać dostęp do panelu.")}finally{c(!1)}}return e.jsxs("main",{className:"relative flex min-h-screen items-center justify-center bg-background px-4",children:[e.jsx("div",{className:"absolute right-4 top-4 z-50",children:e.jsx(w,{})}),e.jsxs("div",{className:"w-full max-w-md rounded-2xl border border-border bg-card p-8 shadow-sm",children:[e.jsx("h1",{className:"serif text-2xl font-medium text-foreground",children:o==="signin"?"Logowanie do panelu":"Załóż konto"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Panel administracyjny Fundacji TQM"}),e.jsxs("form",{onSubmit:b,className:"mt-6 space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"E-mail"}),e.jsx("input",{type:"email",required:!0,value:r,onChange:s=>x(s.target.value),className:"mt-1 w-full rounded-lg border border-input bg-background px-3 py-2 text-sm focus:border-gold focus:outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Hasło"}),e.jsx("input",{type:"password",required:!0,minLength:6,value:i,onChange:s=>f(s.target.value),className:"mt-1 w-full rounded-lg border border-input bg-background px-3 py-2 text-sm focus:border-gold focus:outline-none"})]}),m&&e.jsx("p",{className:"rounded-md bg-red-50 px-3 py-2 text-sm text-red-700",children:m}),e.jsx("button",{type:"submit",disabled:l,className:"w-full rounded-full bg-foreground px-6 py-3 text-sm font-medium text-background transition hover:opacity-90 disabled:opacity-60",children:l?"Trwa logowanie…":o==="signin"?"Zaloguj się":"Zarejestruj się"})]}),e.jsx("button",{onClick:()=>{g(o==="signin"?"signup":"signin"),d(null)},className:"mt-4 w-full text-center text-sm text-muted-foreground hover:text-foreground",children:o==="signin"?"Załóż konto i uzyskaj dostęp":"Masz już konto? Zaloguj się"}),e.jsx("p",{className:"mt-6 text-xs text-muted-foreground",children:"Po rejestracji skontaktuj się z administratorem — nada Ci uprawnienia i otworzy dostęp do panelu."})]})]})}export{k 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.