PageSourceSearch

https://makemywork.de/assets/AuthConfirm-8qy3esT8.js

js makemywork.de collected 2026-10-09 03:13:36 UTC 3,102 bytes, 1 lines download raw bytes

1import{b as C,r as i,s as o,j as e,bh as p,L as A,M as S,k as w}from"./index-BsHPGn1V.js";import{C as E,d as M}from"./card-BTmp5lni.js";function T(n,c){return n.includes("admin")?"/admin":n.includes("worker")&&!n.includes("handwerker")?"/mitarbeiter":c?"/dashboard":"/dashboard/setup"}function D(){const n=C(),[c,l]=i.useState(!0),[d,u]=i.useState(!1),[k,j]=i.useState(0);return i.useEffect(()=>{l(!0),u(!1);let t=!1,a=!1;const m=window.setTimeout(()=>{t||(t=!0,u(a),l(!1))},15e3),g=async()=>{var f,r;if(!(t||a)){a=!0;try{const{data:{session:s},error:b}=await o.auth.getSession();if(t)return;if(b)throw b;if(!(s!=null&&s.user)){a=!1;return}const[h,x]=await Promise.all([o.from("user_roles").select("role").eq("user_id",s.user.id),o.from("profiles").select("onboarding_completed").eq("id",s.user.id).maybeSingle()]);if(h.error||x.error)throw h.error||x.error;if(t)return;window.clearTimeout(m);const N=T(((f=h.data)==null?void 0:f.map(v=>v.role))??[],((r=x.data)==null?void 0:r.onboarding_completed)===!0);window.location.replace(N)}catch{a=!1,t||(t=!0,window.clearTimeout(m),u(!0),l(!1))}}},{data:{subscription:y}}=o.auth.onAuthStateChange((f,r)=>{r!=null&&r.user&&window.setTimeout(()=>{t||g()},0)});return g(),()=>{t=!0,window.clearTimeout(m),y.unsubscribe()}},[k]),c?e.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:e.jsxs(p.div,{initial:{opacity:0}
1,animate:{opacity:1},className:"text-center space-y-4",children:[e.jsx(A,{className:"h-8 w-8 animate-spin mx-auto text-primary"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Bestätigungslink wird geprüft …"})]})}):e.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:e.jsx(p.div,{initial:{opacity:0,y:20,scale:.97},animate:{opacity:1,y:0,scale:1},transition:{duration:.4,ease:"easeOut"},className:"w-full max-w-md",children:e.jsx(E,{className:"shadow-xl border border-border bg-card",children:e.jsxs(M,{className:"pt-8 pb-6 text-center space-y-5",children:[e.jsx("a",{href:"/",children:e.jsx("img",{src:"/makemywork-mark.svg?v=20260929-brand4",alt:"MakeMyWork",className:"mx-auto h-16 w-16 object-contain"})}),e.jsx("div",{className:"mx-auto h-16 w-16 rounded-full bg-emerald-500/10 flex items-center justify-center",children:e.jsx(S,{className:"h-8 w-8 text-emerald-500"})}),e.jsx("h1",{className:"text-xl font-bold text-foreground",children:d?"Verbindung unterbrochen":"Anmeldung noch nicht abgeschlossen"}),e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:d?"Deine Anmeldung konnte gerade nicht geprüft werden. Bitte versuche es erneut. Du musst dich dafür nicht neu registrieren.":"Wir konnten keine aktive Anmeldung feststellen. Öffne den neuesten Bestätigungslink aus deiner E-Mail. Ist der Link abgelaufen, kannst du über die Anmeldung einen neuen anfordern."}),d&&e.jsx(w,{onClick:()=>j(t=>t+1),className:"w-full h-11 font-semibold",children:"Erneut versuchen"}),e.jsx(w,{onClick:()=>n("/auth"),className:"w-full h-11 font-semibold",children:"Zur Anmeldung"})]})})})})}export{D 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.