1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4749],{4739:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/poc/alumni/profile",function(){return r(37242)}])},37242:(e,t,r)=>{"use strict";r.r(t),r.d(t,{WhoAmiI:()=>d,default:()=>c});var n=r(6029),o=r(55729),s=r(65104),a=r(82203),i=r.n(a),l=r(53668);function c(){return(0,n.jsxs)("div",{children:[(0,n.jsx)(d,{redirect:"/admin/poc/alumni/profile"}),(0,n.jsx)(u,{})]})}function u(){let[e,t]=(0,o.useState)();async function r(){let e=await fetch("/api/internal/alumni/profile/me");e.ok?t({data:await e.json()}):t({error:"Failed to fetch alumni profile data"})}return((0,o.useEffect)(()=>{r().catch(e=>{console.error("Error fetching data:",e)})},[]),e)?(0,n.jsx)("div",{children:(0,n.jsx)("pre",{children:JSON.stringify(e,null,2)})}):(0,n.jsx)("div",{children:"Loading..."})}function d(e){var t,r,o,a;let{data:c}=(0,s.s)({url:"/api/auth/session"});if(!c)return(0,n.jsx)("div",{children:"Loading..."});let u=l.z.object({user:l.z.object({displayName:l.z.string()})}).safeParse(c);if(!u.success)return console.error("Validation error:",u.error),(0,n.jsx)("div",{children:"Error validating session data"});let d=(null==(r=(t={resolvedUrl:e.redirect}).ctx)?void 0:r.request.headers["x-cas-auth"])==="legacy"?{loginUrl:"/api/auth/cas/login?redirect=".concat(encodeURIComponent(t.resolvedUrl)),logoutUrl:"/api/auth/cas/logout?redirect=".concat(encodeURIComponent(t.resolvedUrl))}:(null==(o=t.ctx)?void 0:o.request.domain)==="alumni"||(null==(a=t.ctx)?void 0:a.request.domain)==="my"?{loginUrl:"/api/auth/casOauth/login?redirect=".concat(encodeURIComponent(t.resolvedUrl)),logoutUrl:"/api/auth/cas/logout?redirect=".concat(encodeURIComponent(t.resolvedUrl))}:{loginUrl:"/api/auth/cas/login?redirect=".concat(encodeURIComponent(t.resolvedUrl)),logoutUrl:"/api/auth/cas/logout?redirect=".concat(encodeURIComponent(t.resolvedUrl))};return(0,n.jsx)("div",{children:(0,n.jsxs)("h3",{children:[u.data.user.displayName," ",c.user.loggedIn&&(0,n.jsx)(i(),{href:d.logoutUrl,children:"Logout"}),!c.user.loggedIn&&(0,n.jsx)(i(),{href:d.loginUrl,children:"Login"})]})})}},49572:(e,t,r)=>{"use strict";r.d(t,{e8:()=>o,rW:()=>n});let n="environment",o={DEFAULT:"GTM-N2NWNWX",ONLINE:"GTM-MW34RML",EXED:"GTM-TLS4CQL",MY:"GTM-WNLL79Z"}},65104:(e,t,r)=>{"use strict";r.d(t,{G:()=>a,s:()=>i});var n=r(49572),o=r(33681);class s extends Error{constructor(...e){super(...e),this.status=500,this.info={}}}async function a(e){let{url:t,method:r,params:o,headers:a,body:i}=e,l=new URLSearchParams,c=!1;if(o&&Object.entries(o).forEach(e=>{let[t,r]=e;r&&(l.set(t,r),c=!0)}),t.startsWith("/")){let e=new URL(location.href).searchParams.get(n.rW);e&&l.set("environment",e)}c&&(t+="?"+l.toString());let u=await fetch(t,{method:r,headers:a,body:i}),d=u.headers.get("content-type")||"",h=/\bjson\b/i.test(d),f=await u.text(),g=h||""===d&&/^[\s\r\n]*[{[]/.test(f),p=(()=>{if(!f)return null;if(!g)return f;try{return JSON.parse(f)}catch(e){return f}})();if(!u.ok){let e=new s("An error occurred while fetching the data.");throw e.info={status:u.status,statusText:u.statusText,contentType:d,body:p,bodyParseFailed:g&&"string"==typeof p,url:u.url},e.status=u.status,e}if(204===u.status||null===p||""===p)return null;if(!g||"string"==typeof p){let e=new s("Expected JSON but got non-JSON response.");throw e.status=u.status,e.info={status:u.status,statusText:u.statusText,contentType:d,body:p,bodyParseFailed:g&&"string"==typeof p,url:u.url},e}return p}function i(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{enabled:r=!0}=t;return(0,o.Ay)(r?e:null,a,{revalidateOnMount:!0,refreshInterval:0,refreshWhenHidden:!1,refreshWhenOffline:!1,revalidateOnReconnect:!1,revalidateIfStale:!1,revalidateOnFocus:!1,errorRetryCount:3,errorRetryInterval:1e3,keepPreviousData:!0,onSuccess:(e,t)=>{console.info("useFetch success",{key:t,data:e})},onErrorRetry:(t,r,n,o,s)=>{let{retryCount:a}=s;console.info("useFetch error",{key:r,error:t,props:e,retryCount:a}),404!==t.status&&(a>=3||setTimeout(()=>{console.info("useFetch retry",{key:r,props:e,retryCount:a}),o({retryCount:a})},5e3))}})}}},e=>{e.O(0,[3681,3668,2203,636,6593,8792],()=>e(e.s=4739)),_N_E=e.O()}]); 2//# sourceMappingURL=profile-b74b813bc678e357.js.map
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.