1import{r as p,j as e}from"./vendor-query-CkzHihbV.js";import{F as d,G as h,s as f,R as x}from"./index-BkCp4Oim.js";import{a as I}from"./vendor-react-BURQupeV.js";import{L as k}from"./vendor-icons-BXE4rLvZ.js";import"./vendor-three-BdhJKhTS.js";import"./vendor-charts-CmLZutwu.js";import"./vendor-pdf-DcHU7zPv.js";function J(){const o=I(),[r,s]=p.useState(null);return p.useEffect(()=>{(async()=>{const i=new URLSearchParams(window.location.search),c=i.get("token_hash"),n=(i.get("as")||"").toLowerCase();if(!c){s("This impersonation link is invalid.");return}const u=d("https://fkofpzmkuvlhzxgbhigd.supabase.co","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImZrb2Zwem1rdXZsaHp4Z2JoaWdkIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjQ2NDM1NzIsImV4cCI6MjA4MDIxOTU3Mn0.SujlYJfkP87PGsCY3BpGkonm1IeWxYt1FxsSARs7f-c",{auth:{persistSession:!1,autoRefreshToken:!1,detectSessionInUrl:!1}}),{data:t,error:a}=await u.auth.verifyOtp({token_hash:c,type:"magiclink"});if(a||!t.session){s((a==null?void 0:a.message)||"The impersonation link could not be verified.");return}const m=(t.session.user.email||"").toLowerCase();if(n&&m!==n){s(`Impersonation aborted: this link resolved to ${m||"an unknown user"}, not ${n}. Your admin session was left untouched.`);return}h("impersonation");const{error:l}=await f.auth.setSession({access_token:t.session.access_token,refresh_token:t.session.refresh_token});if(l){s(l.message);return}window.history.replaceState(null,"",window.location.pathname),o(x.DASHBOARD,{replace:!0})})()},[o]),e.jsx("main",{className:"min-h-screen bg-background text-foreground flex items-center justify-center p-6",children:e.jsx("div",{className:"text-center",children:r?e.jsx("p",{className:"text-sm text-destructive",children:r}):e.jsxs(e.Fragment,{children:[e.jsx(k,{className:"mx-auto h-6 w-6 animate-spin text-primary"}),e.jsx("p",{className:"mt-3 text-sm text-muted-foreground",children:"Opening customer accountâ¦"})]})})})}export{J 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.