From 9415609ef4e787693134452d799891f36d46b7c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Chalet?= Date: Mon, 28 Nov 2022 04:11:57 +0100 Subject: [PATCH] Use a case-insensitive comparer for PayPal environments --- .../OpenIddictClientWebIntegrationHandlers.Discovery.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Discovery.cs b/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Discovery.cs index de286382..b9e375c8 100644 --- a/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Discovery.cs +++ b/src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Discovery.cs @@ -170,7 +170,8 @@ public static partial class OpenIddictClientWebIntegrationHandlers // prevent the OpenIddict integration from working properly when using the sandbox mode. // To work around that, the endpoints are manually overriden when this environment is used. if (context.Registration.ProviderName is Providers.PayPal && - context.Registration.GetPayPalOptions() is { Environment: PayPal.Environments.Sandbox }) + context.Registration.GetPayPalOptions() is { Environment: string environment } && + string.Equals(environment, PayPal.Environments.Sandbox, StringComparison.OrdinalIgnoreCase)) { context.Configuration.AuthorizationEndpoint = new Uri("https://www.sandbox.paypal.com/signin/authorize", UriKind.Absolute);