mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-04-08 11:58:34 +02:00
prevent nextFormStep
unless credential fully set up (#2599)
This commit is contained in:
parent
e159b2e947
commit
15283b3140
@ -143,35 +143,10 @@ export default function AddConnector({
|
||||
const { liveGDriveCredential } = useGoogleDriveCredentials();
|
||||
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
|
||||
const credentialActivated =
|
||||
(connector === "google_drive" &&
|
||||
(liveGDriveCredential ||
|
||||
appCredentialData ||
|
||||
serviceAccountKeyData ||
|
||||
currentCredential)) ||
|
||||
(connector === "gmail" &&
|
||||
(liveGmailCredential ||
|
||||
appCredentialData ||
|
||||
serviceAccountKeyData ||
|
||||
currentCredential)) ||
|
||||
(connector === "google_drive" && liveGDriveCredential) ||
|
||||
(connector === "gmail" && liveGmailCredential) ||
|
||||
currentCredential;
|
||||
|
||||
// Check if there are no credentials
|
||||
|
Loading…
x
Reference in New Issue
Block a user