PageSourceSearch

https://hintermoos.at/assets/AuthVerify-kFhHI8mY.js

js hintermoos.at collected 2026-10-09 22:01:39 UTC 2,574 bytes, 1 lines download raw bytes

1import{l as p,a as j,u as y,r as l,j as e,M as v,B as N,m as k,n as w,s as u}from"./index-MoAbC8_9.js";import{C as b}from"./circle-check-big-_JLEBINb.js";const L=()=>{const[t]=p(),a=j(),{t:s}=y(),[i,r]=l.useState("awaiting_click"),[g,d]=l.useState("");l.useEffect(()=>{const n=t.get("token_hash"),o=t.get("type");(!n||o!=="magiclink")&&(r("error"),d(s("auth.invalidLink")),setTimeout(()=>a("/login"),3e3))},[t,a,s]);const h=async()=>{const n=t.get("token_hash");if(!n)return;r("verifying"),sessionStorage.setItem("login_method_override","magiclink");const{data:o,error:c}=await u.auth.verifyOtp({token_hash:n,type:"magiclink"});if(c||!o.session){sessionStorage.removeItem("login_method_override"),r("error"),d((c==null?void 0:c.message)||s("auth.verificationFailed")),setTimeout(()=>a("/login"),3e3);return}r("success");const{data:m}=await u.from("user_roles").select("role").eq("user_id",o.session.user.id),x=m==null?void 0:m.some(f=>f.role==="admin");setTimeout(()=>a(x?"/admin":"/owners"),1500)};return e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:e.jsxs("div",{className:"text-center space-y-4 p-8 max-w-md",children:[i==="awaiting_click"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mx-auto h-16 w-16 rounded-full bg-primary/10 flex items-center justify-center",children:e.jsx(v,{className:"h-8 w-8 text-primary"})}),e.jsx("p",{className:"text-lg font-semibold",children:s("auth.magicLinkVerifyTitle")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("auth.clickToContinueLogin")}),e.jsx(N,{onClick:h,className:"w-full h-12 rounded-lg text-base font-semibold bg-primary hover:bg-primary/90 text-primary-foreground shadow-md",children:s("auth.continueToLogin")})]}),i==="verifying"&&e.jsxs(e.Fragment,{children:[e.jsx(k,{className:"h-12 w-12 animate-spin text-primary mx-auto"}),e.jsx("p",{className:"text-lg text-muted-foreground",children:s("auth.verifying")})]}),i==="success"&&e.jsxs(e.Fragment,{children:[e.jsx(b,{className:"h-12 w-12 text-emerald-500 mx-auto"}),e.jsx("p",{className:"text-lg font-semibold",children:s("auth.loginSuccess")}),e.jsx("p",{className:"text-muted-foreground",children:s("auth.redirecting")})]}),i==="error"&&e.jsxs(e.Fragment,{children:[e.jsx(w,{className:"h-12 w-12 text-destructive mx-auto"}),e.jsx("p",{className:"text-lg font-semibold",children:s("auth.verificationFailed")}),e.jsx("p",{className:"text-muted-foreground",children:g}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("auth.redirectingToLogin")})]})]})})};export{L 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.