mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-09-21 14:12:42 +02:00
prevent nextFormStep
unless credential fully set up (#2599)
This commit is contained in:
@@ -143,35 +143,10 @@ export default function AddConnector({
|
|||||||
const { liveGDriveCredential } = useGoogleDriveCredentials();
|
const { liveGDriveCredential } = useGoogleDriveCredentials();
|
||||||
const { liveGmailCredential } = useGmailCredentials();
|
const { liveGmailCredential } = useGmailCredentials();
|
||||||
|
|
||||||
const {
|
|
||||||
data: appCredentialData,
|
|
||||||
isLoading: isAppCredentialLoading,
|
|
||||||
error: isAppCredentialError,
|
|
||||||
} = useSWR<{ client_id: string }, FetchError>(
|
|
||||||
"/api/manage/admin/connector/google-drive/app-credential",
|
|
||||||
errorHandlingFetcher
|
|
||||||
);
|
|
||||||
const {
|
|
||||||
data: serviceAccountKeyData,
|
|
||||||
isLoading: isServiceAccountKeyLoading,
|
|
||||||
error: isServiceAccountKeyError,
|
|
||||||
} = useSWR<{ service_account_email: string }, FetchError>(
|
|
||||||
"/api/manage/admin/connector/google-drive/service-account-key",
|
|
||||||
errorHandlingFetcher
|
|
||||||
);
|
|
||||||
|
|
||||||
// Check if credential is activated
|
// Check if credential is activated
|
||||||
const credentialActivated =
|
const credentialActivated =
|
||||||
(connector === "google_drive" &&
|
(connector === "google_drive" && liveGDriveCredential) ||
|
||||||
(liveGDriveCredential ||
|
(connector === "gmail" && liveGmailCredential) ||
|
||||||
appCredentialData ||
|
|
||||||
serviceAccountKeyData ||
|
|
||||||
currentCredential)) ||
|
|
||||||
(connector === "gmail" &&
|
|
||||||
(liveGmailCredential ||
|
|
||||||
appCredentialData ||
|
|
||||||
serviceAccountKeyData ||
|
|
||||||
currentCredential)) ||
|
|
||||||
currentCredential;
|
currentCredential;
|
||||||
|
|
||||||
// Check if there are no credentials
|
// Check if there are no credentials
|
||||||
|
Reference in New Issue
Block a user