From 8688d9b686237a12133fea8d29de246e24c7d6fe Mon Sep 17 00:00:00 2001 From: Bernie Chiu Date: Wed, 13 Nov 2024 17:12:09 +0800 Subject: [PATCH] Fix option pkce verifier cannot be set due to overwrites --- lib/omniauth/strategies/oauth2.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/omniauth/strategies/oauth2.rb b/lib/omniauth/strategies/oauth2.rb index 1588926..f0b929e 100644 --- a/lib/omniauth/strategies/oauth2.rb +++ b/lib/omniauth/strategies/oauth2.rb @@ -105,7 +105,7 @@ def callback_phase # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexi def pkce_authorize_params return {} unless options.pkce - options.pkce_verifier = SecureRandom.hex(64) + options.pkce_verifier ||= SecureRandom.hex(64) # NOTE: see https://tools.ietf.org/html/rfc7636#appendix-A {