mirror of https://github.com/langgenius/dify.git
feat(oauth): improve credential schema validation in provider
This commit is contained in:
parent
0532135a9c
commit
ab6ae1f209
|
|
@ -139,9 +139,9 @@ class BuiltinToolProviderController(ToolProviderController):
|
|||
returns the credential support type of the provider
|
||||
"""
|
||||
types = []
|
||||
if self.entity.credentials_schema is not None:
|
||||
if self.entity.credentials_schema is not None and len(self.entity.credentials_schema) > 0:
|
||||
types.append(CredentialType.API_KEY.value)
|
||||
if self.entity.oauth_schema is not None:
|
||||
if self.entity.oauth_schema is not None and len(self.entity.oauth_schema.credentials_schema) > 0:
|
||||
types.append(CredentialType.OAUTH2.value)
|
||||
return types
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue