PageSourceSearch

https://www.trouwassistent.nl/assets/AdminLogin-B2h8ZTQp.js

js trouwassistent.nl collected 2026-10-02 01:06:32 UTC 3,122 bytes, 1 lines download raw bytes

1import{j as e}from"./ui-DGDVfbFn.js";import{u as s,h as a,a as t}from"./react-vendor-CG7WfdSN.js";import{D as r,e as i,g as o,h as l,l as n,B as c,s as m}from"./index-BEigjK7B.js";import{I as d}from"./input-B3Vwc5ya.js";import{L as h}from"./label-DFtUkIV6.js";import{A as u,a as p}from"./alert-BIJxlNbR.js";import{E as x}from"./eye-off-CcxJxT7_.js";import{E as f}from"./eye-CPrD0zy6.js";import{L as j}from"./loader-circle-D0ynUUPP.js";import"./supabase-BrKiwD5U.js";import"./charts-ChniAfy4.js";const g=()=>{const g=s(),b=a(),{isAdmin:w,loading:v}=r(),[y,N]=t.useState(""),[C,S]=t.useState(""),[D,E]=t.useState(!1),[I,k]=t.useState(!1),[A,L]=t.useState(null),F=b.state?.from?.pathname??"/frecklesonscreen/dashboard/shop";t.useEffect(()=>{!v&&w&&g(F,{replace:!0})},[w,v,g,F]);return v?null:e.jsx("div",{className:"min-h-screen bg-gradient-to-br from-[#f8f8f8] via-white to-[#f8f8f8] flex items-center justify-center px-4",children:e.jsxs(i,{className:"border-0 shadow-xl bg-white w-full max-w-sm",children:[e.jsxs(o,{className:"text-center pb-4",children:[e.jsx("span",{className:"text-2xl font-bold text-[#a2c4c9]",style:{fontFamily:"Dancing Script, cursive"},children:"TrouwAssistent"}),e.jsx(l,{className:"text-lg font-semibold text-gray-800 mt-1",children:"Admin Dashboard"})]}),e.jsx(n,{children:e.jsxs("form",{onSubmit:async e=>{e.preventDefault(),L(null),k(!0);try{const e=y.trim().toLowerCase(),{data:s,error:a}=await m.auth.signInWithPassword({email:e,password:C});if(a){const e=a.message.toLowerCase();return void(e.includes("invalid")||e.includes("credentials")?L("Ongeldige email of wachtwoord."):e.includes("rate")||e.includes("too many")?L("Te veel pogingen. Wacht even en probeer opnieuw."):L("Inloggen mislukt. Probeer opnieuw."))}if("admin"!==s.user?.app_metadata?.role)return await m.auth.signOut(),void L("Dit account heeft geen toegang tot het admin dashboard.");g("/frecklesonscreen/dashboard/shop",{replace:!0})}catch{L("Er ging iets mis. Probeer opnieuw.")}finally{k(!1)}},className:"space-y-4",children:[A&&e.jsx(u,{className:"bg-red-50 border-red-200",children:e.jsx(p,{className:"text-red-700 text-sm",children:A})}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(h,{htmlFor:"email",children:"Email"}),e.jsx(d,{id:"email",type:"email",value:y,onChange:e=>N(e.target.value),placeholder:"[email protected]",required:!0,autoComplete:"email"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(h,{htmlFor:"password",children:"Wachtwoord"}),e.jsxs("div",{className:"relative",children:[e.jsx(d,{id:"password",type:D?"text":"password",value:C,onChange:e=>S(e.target.value),required:!0,autoComplete:"current-password",className:"pr-10"}),e.jsx("button",{type:"button",onClick:()=>E(e=>!e),className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600",tabIndex:-1,children:D?e.jsx(x,{className:"h-4 w-4"}):e.jsx(f,{className:"h-4 w-4"})})]})]}),e.jsxs(c,{type:"submit",className:"w-full bg-[#a2c4c9] hover:bg-[#8bb1b6] text-white",disabled:I||!y||!C,children:[I&&e.jsx(j,{className:"h-4 w-4 animate-spin mr-2"}),"Inloggen"]})]})})]})})};export{g 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.