1import{e as g,u as m}from"./vendor-vue-BIDZeepx.js";import{u as y}from"./useAuth-ClVvOQEe.js";import{i as l,s as p,f as h,R as _,k,V as v,_ as w}from"./index-BNPflmqD.js";import{k as A,r as S,_ as b,y as q,z as C,K as n,H as R}from"./vendor-misc-5pJBpqhN.js";import"./vendor-tanstack-B6ELLr_Q.js";import"./vendor-sentry-84cD2ryj.js";import"./vendor-utils-CxkvrZ9U.js";const B={class:"oauth-callback"},M={class:"loading-container"},x=A({__name:"OAuthCallback",setup(E){const t=g(),s=m(),i=y(),e=S("Completing sign in...");function d(){return l()?"creator":t.query.workspace==="agency"?"agency":t.query.workspace==="creator"?"creator":v()}return b(async()=>{const c=typeof t.query.code=="string"?t.query.code:null,o=d(),f=t.query.new_account==="1";if(!c){await s.replace("/login?error=auth_failed");return}try{if(e.value="Establishing session...",await i.completeGoogleOAuthCallback(c),window.history.replaceState({},document.title,"/oauth-callback"),l()){p("creator"),e.value="Success! Redirecting...",await s.replace("/home");return}const a=h();if(a.initFromMemberships(),!a.hasAgencyAccess){e.value="Loading workspace...";try{await i.refreshProfile(),a.initFromMemberships()}catch{}}let r,u=null;a.hasAgencyAccess?r="agency":o==="creator"?r="creator":(r="agency",u=f?"/agency/onboard":"/agency/no-access"),p(r),e.value="Success! Redirecting...",await s.replace(u??_(r))}catch(a){e.value=k(a,"Authentication failed. Please try again."),setTimeout(()=>{s.replace("/login?error=auth_failed")},1500)}}),(c,o)=>(q(),C("div",B,[n("div",M,[o[0]||(o[0]=n("div",{class:"spinner"},null,-1)),n("p",null,R(e.value),1)])]))}}),z=w(x,[["__scopeId","data-v-c0028c5d"]]);export{z 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.