supertokens / supertokens-node

Node SDK for SuperTokens core
https://supertokens.com
Other
281 stars 72 forks source link

Enhancement: Improve handling of OAuth providers with single configuration when clientType is specified #757

Open anku255 opened 7 months ago

anku255 commented 7 months ago

Consider a case where one OAuth provider has multiple config with different clientType but providers have only one config. Since, the frontend client has setup the clientType in the global config, it will always pass that but the backend SDK will fail to find the config for the provider with the given clientType as there is only one config (without specified clientType).

Currently, users need to provide multiple config for each provider in the backendConfig to fix this but a SDK level fix could just ignore the clientType if the provider has only one config.