()
| 231 | // ── OIDC helpers ────────────────────────────────────────────────────────── |
| 232 | |
| 233 | private async getDiscovery(): Promise<OIDCDiscovery> { |
| 234 | if (this.discovery) return this.discovery; |
| 235 | const url = `${this.issuer}/.well-known/openid-configuration`; |
| 236 | const doc = await fetchJSON<OIDCDiscovery>(url); |
| 237 | this.discovery = doc; |
| 238 | return doc; |
| 239 | } |
| 240 | |
| 241 | private async exchangeCode(tokenEndpoint: string, code: string): Promise<TokenResponse> { |
| 242 | const body = new URLSearchParams({ |