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.
This commit is contained in:
JhumanJ 2025-04-10 12:20:34 +02:00
parent 5cb07191db
commit 8cb6e1238f
1 changed files with 3 additions and 2 deletions

View File

@ -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
}