mirror of
https://github.com/langgenius/dify.git
synced 2026-05-03 17:08:03 +08:00
tool oauth
This commit is contained in:
@ -7,9 +7,11 @@ import { CredentialTypeEnum } from './types'
|
||||
|
||||
type PluginAuthProps = {
|
||||
provider?: string
|
||||
children?: React.ReactNode
|
||||
}
|
||||
const PluginAuth = ({
|
||||
provider = '',
|
||||
children,
|
||||
}: PluginAuthProps) => {
|
||||
const { data } = useGetPluginToolCredentialInfo(provider)
|
||||
const { isCurrentWorkspaceManager } = useAppContext()
|
||||
@ -30,7 +32,7 @@ const PluginAuth = ({
|
||||
)
|
||||
}
|
||||
{
|
||||
isAuthorized && (
|
||||
isAuthorized && !children && (
|
||||
<Authorized
|
||||
provider={provider}
|
||||
credentials={data?.credentials}
|
||||
@ -40,6 +42,9 @@ const PluginAuth = ({
|
||||
/>
|
||||
)
|
||||
}
|
||||
{
|
||||
isAuthorized && children
|
||||
}
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user