From 8cb6e1238fea168bbff18a32687853867db031f3 Mon Sep 17 00:00:00 2001 From: JhumanJ Date: Thu, 10 Apr 2025 12:20:34 +0200 Subject: [PATCH] Enhance OAuth Providers Configuration for Stripe Integration - Updated the Stripe provider configuration to dynamically set the `enabled` state based on feature flags, improving flexibility in feature management. - Introduced an `auth_type` property for the Stripe provider, ensuring that the authentication method aligns with the expected flow for users. - Modified the service configuration check to ensure that the `auth_type` is validated before proceeding, enhancing the robustness of the OAuth handling logic. These changes aim to improve the integration of Stripe within the OAuth providers, ensuring better control over feature availability and authentication processes. --- client/stores/oauth_providers.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client/stores/oauth_providers.js b/client/stores/oauth_providers.js index 4b1fd1b4..eaa68014 100644 --- a/client/stores/oauth_providers.js +++ b/client/stores/oauth_providers.js @@ -24,7 +24,8 @@ export const useOAuthProvidersStore = defineStore("oauth_providers", () => { name: 'stripe', title: 'Stripe', icon: 'cib:stripe', - enabled: true + enabled: featureFlagsStore.getFlag('billing.stripe_publishable_key', false), + auth_type: 'redirect' }, { name: 'telegram', @@ -57,7 +58,7 @@ export const useOAuthProvidersStore = defineStore("oauth_providers", () => { contentStore.resetState() const serviceConfig = getService(service) - if (serviceConfig && serviceConfig.auth_type !== 'redirect') { + if (serviceConfig && serviceConfig.auth_type && serviceConfig.auth_type !== 'redirect') { return }