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

//# sourceMappingURL=plugins_oidc_discovery-handler_ts_0esi_p-._.js.map