1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5367],{37457:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/forum-sso",function(){return t(38552)}])},38552:function(e,n,t){"use strict";t.r(n),t.d(n,{__N_SSP:function(){return k},default:function(){return y}});var r=t(85893),o=t(93207),a=t(2962),s=t(47568),i=t(97582),c=t(67294),u=t(98456),l=t(79172),f=t(47041),d=t(11163),p=t(96245);function h(e,n){return m.apply(this,arguments)}function m(){return(m=(0,s.Z)((function(e,n){var t,r,o;return(0,i.__generator)(this,(function(a){switch(a.label){case 0:return t=new TextEncoder,[4,crypto.subtle.importKey("raw",t.encode(e),{name:"HMAC",hash:"SHA-256"},!1,["sign"])];case 1:return r=a.sent(),[4,crypto.subtle.sign("HMAC",r,t.encode(n))];case 2:return o=a.sent(),[2,Array.from(new Uint8Array(o)).map((function(e){return e.toString(16).padStart(2,"0")})).join("")]}}))}))).apply(this,arguments)}function _(e,n){return w.apply(this,arguments)}function w(){return(w=(0,s.Z)((function(e,n){var t,r,o;return(0,i.__generator)(this,(function(a){switch(a.label){case 0:return t=new URLSearchParams(e).toString(),r=btoa(unescape(encodeURIComponent(t))),[4,h(n,r)];case 1:return o=a.sent(),[2,{returnSSO:encodeURIComponent(r),returnSig:encodeURIComponent(o)}]}}))}))).apply(this,arguments)}var g=function(e){e.data;var n=(0,d.useRouter)();return(0,c.useEffect)((function(){function e(){return(e=(0,s.Z)((function(){var e,t,r,o,a,s,c,u,l,d,m,w,g,k,y,v,x,S,C,b,A,j,E,R,U,Z;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:return r="Z?~@QjM[igYwIbf",o=(0,f.getCookie)("forum_sso"),a=o?JSON.parse(o):{sso:"",sig:""},s=a.sso,c=a.sig,[4,h(r,s)];case 1:if(i.sent()!==c)return window.location.href="https://forum.katalon.com?message=invalid-sso-signature",[2];if(u=n.query.context,d=null!==(l=n.query.code)&&void 0!==l?l:"",!u)return window.location.href="https://forum.katalon.com?message=authentication-failed",[2];(m=new URLSearchParams).append("scope","openid"),m.append("client_id","katalon-forum"),m.append("client_secret","VBiUAJu4KjZOo29schA7STh90IzbjYDE"),m.append("redirect_uri","".concat("https://katalon.com","/forum-sso")),m.append("grant_type","authorization_code"),m.append("code",d),i.label=2;case 2:return i.trys.push([2,5,,6]),[4,fetch("".concat("https://login.katalon.com/realms/katalon","/protocol/openid-connect/token"),{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:m})];case 3:if(!(g=i.sent()).ok)throw new Error("Token fetch failed");return[4,g.json()];case 4:return w=i.sent(),[3,6];case 5:return i.sent(),window.location.href="https://forum.katalon.com?message=authentication-failed",[2];case 6:k=w.access_token,y=(0,p.Z)(k),v=172800,(0,f.setCookie)("wp_user_katone_token",k,{maxAge:v}),(0,f.setCookie)("wp_user_katone_refresh_token",w.refresh_token,{maxAge:v}),(0,f.setCookie)("user_email",y.email,{maxAge:v}),(0,f.setCookie)("wp_user_email",y.email,{maxAge:v}),(0,f.setCookie)("user_display_name","".concat(y.given_name," ").concat(y.family_name),{maxAge:v}),(0,f.setCookie)("verify_email_status",y.email_verified,{maxAge:v}),i.label=7;case 7:return i.trys.push([7,10,,11]),[4,fetch("".concat("https://api.katalon.com","/v1/auth/me"),{headers:{Authorization:"Bearer ".concat(k)}})];case 8:if(!(S=i.sent()).ok)throw new Error("User fetch failed");return[4,S.json()];case 9:return x=i.sent(),[3,11];case 10:return i.sent(),window.location.href="https://forum.katalon.com?message=authentication-failed",[2];case 11:return C=decodeURIComponent(escape(atob(s))),b=new URLSearchParams(C),A=b.get("nonce"),j=b.get("return_sso_url"),[4,_({nonce:A,email:y.email,external_id:null!==(E=null===x||void 0===x||null===(e=x.data)||void 0===e||null===(t=e.id)||void 0===t?void 0:t.toString())&&void 0!==E?E:"",username:y.preferred_username,name:y.name,require_activation:"false",avatar_force_update:"false"},r)];case 12:return R=i.sent(),U=R.returnSSO,Z=R.returnSig,(0,f.deleteCookie)("forum_sso"),window.location.href="".concat(j,"?sso=").concat(U,"&sig=").concat(Z),[2]}}))}))).apply(this,arguments)}n.isReady&&function(){e.apply(this,arguments)}()}),[n.isReady]),(0,r.jsx)(l.Z,{sx:{width:"100%",display:"flex",justifyContent:"center",alignItems:"center",height:"100vh"},children:(0,r.jsx)(u.Z,{})})},k=!0;function y(e){var n=e.data;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(g,{data:n}),(0,r.jsx)(a.PB,{noindex:!0,nofollow:!0})]})}y.getLayout=function(e){return(0,r.jsx)(o.Z,{children:e})}}},function(e){e.O(0,[571,3102,2778,3207,9774,2888,179],(function(){return n=37457,e(e.s=n);var n}));var n=e.O();_N_E=n}]);
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.