Closed mo36924 closed 1 week ago
supportsPKCE return value is incorrect.
https://github.com/panva/openid-client/blob/ff1436ea991d771b0257a7c12752621ae6abaaf9/src/index.ts#L1464-L1472
The following code may be more correct.
metadata.code_challenge_methods_supported?.includes(method) === true
v6.1.0
Node.js
v20.17.0
import { equal } from "node:assert"; import { discovery } from "openid-client"; const config = await discovery(new URL("https://accounts.google.com"), "clientId", "clientSecret"); equal(config.serverMetadata().code_challenge_methods_supported?.includes("S256"), true); // The following line throws an error equal(config.serverMetadata().supportsPKCE(), true);
Damn you're right, i took the code from my previous examples that was checking for anything but true.
Fixed in https://github.com/panva/openid-client/releases/tag/v6.1.1
What happened?
supportsPKCE return value is incorrect.
https://github.com/panva/openid-client/blob/ff1436ea991d771b0257a7c12752621ae6abaaf9/src/index.ts#L1464-L1472
The following code may be more correct.
Version
v6.1.0
Runtime
Node.js
Runtime Details
v20.17.0
Code to reproduce
Required