tool oauth

This commit is contained in:
zxhlyh
2025-07-09 18:28:39 +08:00
parent ce8bf7b5a2
commit 8968a3e254
19 changed files with 432 additions and 124 deletions

View File

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