module.exports=[824727,e=>{"use strict";var s=e.i(89171);async function t(e){let t,r=e.nextUrl.searchParams.get("issuer");if(!r)return s.NextResponse.json({error:"Missing issuer parameter"},{status:400});try{t=new URL(r)}catch{return s.NextResponse.json({error:"Invalid issuer URL"},{status:400})}if("https:"!==t.protocol)return s.NextResponse.json({error:"Issuer must use HTTPS"},{status:400});let n=`${r.replace(/\/$/,"")}/.well-known/openid-configuration`;try{let e=await fetch(n,{headers:{Accept:"application/json"},signal:AbortSignal.timeout(5e3)});if(!e.ok)return s.NextResponse.json({error:`Discovery endpoint returned ${e.status}`},{status:e.status});let t=await e.json();return s.NextResponse.json(t,{headers:{"Cache-Control":"public, max-age=300"}})}catch(t){let e=t instanceof Error?t.message:String(t);return s.NextResponse.json({error:`Discovery failed: ${e}`},{status:502})}}e.s(["GET",0,t])}];

//# sourceMappingURL=plugins_oidc_discovery-handler_ts_1_lj-so._.js.map