PageSourceSearch

https://aidealer360.com/assets/OAuthConsent-BGoGRuCW.js

js aidealer360.com collected 2026-10-01 15:56:12 UTC 3,568 bytes, 1 lines download raw bytes

1import{j as e}from"./ui-vendor-B12AOeKi.js";import{u as A,r as u}from"./react-vendor-DZt7wVAJ.js";import{s as C,q as v,v as z,w as _,y as E,P as w,B as N}from"./index-BZo64Z7H.js";import{S as I}from"./shield-check-Ab0Toy73.js";import"./charts-vendor-B6q1L48j.js";import"./supabase-vendor-dOy44Gxq.js";import"./animation-vendor-BAVy02gd.js";function d(){return C.auth.oauth}function $(){var f,g,y;const[S]=A(),n=S.get("authorization_id")??"",[s,b]=u.useState(null),[o,a]=u.useState(null),[m,l]=u.useState(!1);u.useEffect(()=>{let i=!0;return(async()=>{if(!n){a("Missing authorization_id in the request URL.");return}const{data:r}=await C.auth.getSession();if(!r.session){const t=window.location.pathname+window.location.search;window.location.href=`/login?redirect=${encodeURIComponent(t)}`;return}try{const{data:t,error:c}=await d().getAuthorizationDetails(n);if(!i)return;if(c){a(c.message);return}const j=(t==null?void 0:t.redirect_url)??(t==null?void 0:t.redirect_to);if(j&&!(t!=null&&t.client)){window.location.href=j;return}b(t)}catch(t){i&&a(t instanceof Error?t.message:String(t))}})(),()=>{i=!1}},[n]);const h=async i=>{l(!0);try{const{data:r,error:t}=i?await d().approveAuthorization(n):await d().denyAuthorization(n);if(t){a(t.message),l(!1);return}const c=(r==null?void 0:r.redirect_url)??(r==null?void 0:r.redirect_to);if(!c){a("No redirect returned by the authorization server."),l(!1);return}window.location.href=c}catch(r){a(r instanceof Error?r.message:String(r)),l(!1)}},p=((f=s==null?void 0:s.client)==null?void 0:f.name)??((g=s==null?void 0:s.client)==null?void 0:g.client_name)??"an application",x=typeof(s==null?void 0:s.scope)=="string"?s.scope.split(/\s+/).filter(Boolean):[];return e.jsx("main",{className:"min-h-screen flex items-center justify-center p-4",children:e.jsxs(v,{className:"w-full max-w-lg",children:[e.jsx(z,{children:e.jsxs(_,{className:"flex items-center gap-2 text-xl",children:[e.jsx(I,{className:"h-5 w-5 text-primary"}),o?"Authorization problem":`Connect ${p} to AI Dealer360`]})}),e.jsxs(E,{className:"space-y-4",children:[o&&e.jsx("p",{className:"text-sm text-destructive",children:o}),!o&&!s&&e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(w,{className:"h-4 w-4 animate-spin"})," Loading authorization request…"]}),!o&&s&&e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:["This lets ",e.jsx("span",{className:"font-medium text-foreground",children:p})," use AI Dealer360 as you. It can call this app's enabled tools while you are signed in."]}),((y=s==null?void 0:s.client)==null?void 0:y.redirect_uri)&&e.jsxs("p",{className:"text-xs text-muted-foreground break-all",children:["Redirects to: ",s.client.redirect_uri]}),x.length>0&&e.jsx("ul",{className:"text-sm list-disc pl-5 space-y-1",children:x.map(i=>e.jsx("li",{children:i==="profile"?"Share your basic profile":i==="email"?"Share your email address":i==="openid"?"Confirm your identity":`Additional permission requested: ${i}`},i))}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"This does not bypass AI Dealer360 permissions or dealership data policies — the connected app only sees what your account can already see."}),e.jsxs("div",{className:"flex gap-3 pt-2",children:[e.jsxs(N,{disabled:m,onClick:()=>h(!0),className:"flex-1",children:[m&&e.jsx(w,{className:"h-4 w-4 animate-spin mr-2"}),"Approve"]}),e.jsx(N,{disabled:m,variant:"outline",onClick:()=>h(!1),className:"flex-1",children:"Cancel connection"})]})]})]})]})})}export{$ 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.