mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-09-28 21:05:17 +02:00
hide oauth sources (#3368)
This commit is contained in:
@@ -19,7 +19,11 @@ import AdvancedFormPage from "./pages/Advanced";
|
|||||||
import DynamicConnectionForm from "./pages/DynamicConnectorCreationForm";
|
import DynamicConnectionForm from "./pages/DynamicConnectorCreationForm";
|
||||||
import CreateCredential from "@/components/credentials/actions/CreateCredential";
|
import CreateCredential from "@/components/credentials/actions/CreateCredential";
|
||||||
import ModifyCredential from "@/components/credentials/actions/ModifyCredential";
|
import ModifyCredential from "@/components/credentials/actions/ModifyCredential";
|
||||||
import { ConfigurableSources, ValidSources } from "@/lib/types";
|
import {
|
||||||
|
ConfigurableSources,
|
||||||
|
oauthSupportedSources,
|
||||||
|
ValidSources,
|
||||||
|
} from "@/lib/types";
|
||||||
import { Credential, credentialTemplates } from "@/lib/connectors/credentials";
|
import { Credential, credentialTemplates } from "@/lib/connectors/credentials";
|
||||||
import {
|
import {
|
||||||
ConnectionConfiguration,
|
ConnectionConfiguration,
|
||||||
@@ -154,13 +158,7 @@ export default function AddConnector({
|
|||||||
const configuration: ConnectionConfiguration = connectorConfigs[connector];
|
const configuration: ConnectionConfiguration = connectorConfigs[connector];
|
||||||
|
|
||||||
// Form context and popup management
|
// Form context and popup management
|
||||||
const {
|
const { setFormStep, setAllowCreate, formStep } = useFormContext();
|
||||||
setFormStep,
|
|
||||||
setAllowCreate: setAllowCreate,
|
|
||||||
formStep,
|
|
||||||
nextFormStep,
|
|
||||||
prevFormStep,
|
|
||||||
} = useFormContext();
|
|
||||||
const { popup, setPopup } = usePopup();
|
const { popup, setPopup } = usePopup();
|
||||||
|
|
||||||
// Hooks for Google Drive and Gmail credentials
|
// Hooks for Google Drive and Gmail credentials
|
||||||
@@ -452,8 +450,9 @@ export default function AddConnector({
|
|||||||
>
|
>
|
||||||
Create New
|
Create New
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
{/* Button to sign in via OAuth */}
|
{/* Button to sign in via OAuth */}
|
||||||
|
{oauthSupportedSources.includes(connector) &&
|
||||||
|
NEXT_PUBLIC_CLOUD_ENABLED && (
|
||||||
<button
|
<button
|
||||||
onClick={handleAuthorize}
|
onClick={handleAuthorize}
|
||||||
className="mt-6 text-sm bg-blue-500 px-2 py-1.5 flex text-text-200 flex-none rounded"
|
className="mt-6 text-sm bg-blue-500 px-2 py-1.5 flex text-text-200 flex-none rounded"
|
||||||
@@ -462,8 +461,11 @@ export default function AddConnector({
|
|||||||
>
|
>
|
||||||
{isAuthorizing
|
{isAuthorizing
|
||||||
? "Authorizing..."
|
? "Authorizing..."
|
||||||
: `Authorize with ${getSourceDisplayName(connector)}`}
|
: `Authorize with ${getSourceDisplayName(
|
||||||
|
connector
|
||||||
|
)}`}
|
||||||
</button>
|
</button>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
@@ -325,3 +325,9 @@ export type ConfigurableSources = Exclude<
|
|||||||
ValidSources,
|
ValidSources,
|
||||||
ValidSources.NotApplicable | ValidSources.IngestionApi
|
ValidSources.NotApplicable | ValidSources.IngestionApi
|
||||||
>;
|
>;
|
||||||
|
|
||||||
|
export const oauthSupportedSources: ConfigurableSources[] = [
|
||||||
|
ValidSources.Slack,
|
||||||
|
];
|
||||||
|
|
||||||
|
export type OAuthSupportedSource = (typeof oauthSupportedSources)[number];
|
||||||
|
Reference in New Issue
Block a user