Skip to content

Commit

Permalink
refactor(passport): use the supportsPKCE() metadata helper
Browse files Browse the repository at this point in the history
  • Loading branch information
panva committed Feb 19, 2025
1 parent dde4b44 commit e13fb37
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/passport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit e13fb37

Please sign in to comment.