refactor(passport): use the supportsPKCE() metadata helper

This commit is contained in:
Filip Skokan
2025-02-19 17:10:14 +01:00
parent 3d331644d0
commit 3e82e28b4f
+1 -3
View File
@@ -242,9 +242,7 @@ export class Strategy implements passport.Strategy {
redirectTo.searchParams.set('code_challenge_method', 'S256')
if (
this._config
.serverMetadata()
.code_challenge_methods_supported?.includes('S256') !== true &&
!this._config.serverMetadata().supportsPKCE() &&
!redirectTo.searchParams.has('nonce')
) {
redirectTo.searchParams.set('state', client.randomState())