1import{i as g,k as u,R as h,gh as f,r as b,j as o}from"./index-YNsGwUAq.js";import{u as x,a as I}from"./mutations-B4kKc9Cs.js";import"./queries-BnT10Uwg.js";import{G as S}from"./gitlab-connection-qSNF4OHB.js";const y=()=>{const t=g(),{mutateAsync:r}=x(),{mutateAsync:c}=I(),{code:s,state:i}=u({from:h.SecretManager.Integratons.GitlabOauthCallbackPage.id}),{currentProject:l}=f();return b.useEffect(()=>{(async()=>{try{const[a]=i.split("|",2),p=localStorage.getItem("latestCSRFToken");if(a!==p){console.error("CSRF token mismatch"),t({to:"/organization/app-connections",search:{error:"invalid_state"}});return}localStorage.removeItem("latestCSRFToken");const d=localStorage.getItem("gitlabConnectionFormData");if(!d){console.error("No stored form data found"),t({to:"/organization/app-connections",search:{error:"missing_form_data"}});return}const e=JSON.parse(d);localStorage.removeItem("gitlabConnectionFormData");const m={...e,method:S.OAuth,credentials:{code:s}};let n;e.isUpdate&&e.connectionId?n=await c({connectionId:e.connectionId,...m}):n=await r({workspaceId:l.id,...m}),t({to:"/organization/app-connections",search:{success:e.isUpdate?"connection_updated":"connection_created",connectionId:n.id}})}catch(a){console.error("Error handling GitLab OAuth callback:",a),t({to:"/organization/app-connections",search:{error:"connection_failed"}})}})()},[s,i,t,r,c,l.id]),o.jsx("div",{className:"flex h-screen items-center justify-center",children:o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:"mx-auto mb-4 h-8 w-8 animate-spin rounded-full border-b-2 border-primary"}),o.jsx("p",{className:"text-gray-600",children:"Connecting to GitLab..."})]})})},C=y;export{C as component};
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.