var e=window.opener.swaggerUIRedirectOauth2,t=e.state,n=e.redirectUrl,r=/code|token|error/.test(window.location.hash)?window.location.hash.substring(1).replace(`?`,`&`):location.search.substring(1),i=r.split(`&`);for(let e=0;e<i.length;e++)i[e]=`"${i[e].replace(`=`,`":"`)}"`;var a=r?JSON.parse(`{${i.join()}}`,(e,t)=>e===``?t:decodeURIComponent(t)):{},o=a.state===t;if((e.auth.schema.get(`flow`)===`accessCode`||e.auth.schema.get(`flow`)===`authorizationCode`||e.auth.schema.get(`flow`)===`authorization_code`)&&!e.auth.code)if(o||e.errCb({authId:e.auth.name,source:`auth`,level:`warning`,message:`Authorization may be unsafe, passed state was changed in server. The passed state wasn't returned from auth server.`}),a.code)delete e.state,e.auth.code=a.code,e.callback({auth:e.auth,redirectUrl:n});else{let t;a.error&&(t=`[${a.error}]: ${a.error_description?`${a.error_description}. `:`no accessCode received from the server. `}${a.error_uri?`More info: ${a.error_uri}`:``}`),e.errCb({authId:e.auth.name,source:`auth`,level:`error`,message:t||`[Authorization failed]: no accessCode received from the server.`})}else e.callback({auth:e.auth,token:a,isValid:o,redirectUrl:n});window.close();
//# sourceMappingURL=swagger-oauth2-redirect-B_cuDrbk.js.map