1import{l as w}from"./logger-CMFm2Jnj.js";import{u as A,p as S,a0 as v}from"./index-Cc-ERo76.js";import{d as g,a5 as k,r as E,a as T,a8 as t,N as s,S as u,M as l,L as c,f as C,v as R}from"./vendor-vue-C9I4HdhY.js";import"./vendor-moment-DSem4xRw.js";import"./vendor-editor-markdown-BjRGdLHa.js";import"./vendor-charts-CVpKHQhc.js";import"./vendor-i18n-BYicniCH.js";import"./vendor-motion-yh3LNOre.js";const U={LOADING:"Loading ...",FETCH_ERROR:"Seems like there is no record here. How about we start with creating one :) ?",UPDATE_SUCCESS:"Update successful.",UPDATING:"Updating ...",UPDATE_ERROR:"Update error. Please try again later.",AUTH_FAILED:"Authentication failed.",AUTH_SUCCESS:"Authentication completed.",ERROR:"Error"},H=g({__name:"auth-callback",setup(x){const o=k(),_=v.authToken,p=A(),m=S(),r=E("loading");async function d(){const n=o.currentRoute.value.query.code;n||o.push("/");try{const e=(await(await fetch(`${window.__APP_CONFIG__.API_BASE_URL}/iam/authentication/oauth/${window.__APP_CONFIG__.OAUTH_CLIENT_ID}/access-token?code=${n}`,{method:"POST",headers:{"Content-Type":"application/json"}})).json()).access_token;if(!e)throw new Error("Missing `token` key from JSON response");_.value=e,await Promise.all([p.fetch(),m.fetch()]),o.push("/")}catch(a){w.error("Error exchanging code for auth token",a),r.value="error"}}return T(d),(n,a)=>{const i=t("v-progress-circular"),e=t("v-row"),h=t("v-alert"),f=t("v-container");return c(),s(f,{class:"h-screen flex items-center justify-center","max-width":"100%"},{default:u(()=>[r.value==="loading"?(c(),s(e,{key:0,align:"center",justify:"center"},{default:u(()=>[C(i,{color:"primary",indeterminate:"",size:40,width:4})]),_:1})):l("",!0),r.value==="error"?(c(),s(h,{key:1,title:R(U).AUTH_FAILED,text:"There was an error in authentication. You will now be redirected to authentication portal in 3 seconds.",type:"error",variant:"tonal",class:"max-h-[100px] max-w-[600px] block"},null,8,["title"])):l("",!0)]),_:1})}}});
1export{H 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.