diff --git a/backend/onyx/connectors/linear/connector.py b/backend/onyx/connectors/linear/connector.py index 07f4bce2eee9..a3b8a59d65d1 100644 --- a/backend/onyx/connectors/linear/connector.py +++ b/backend/onyx/connectors/linear/connector.py @@ -91,6 +91,7 @@ class LinearConnector(LoadConnector, PollConnector, OAuthConnector): f"&response_type=code" f"&scope=read" f"&state={state}" + f"&prompt=consent" # prompts user for access; allows choosing workspace ) @classmethod diff --git a/backend/onyx/server/documents/standard_oauth.py b/backend/onyx/server/documents/standard_oauth.py index 91cd5322ec70..dd95806d5c7f 100644 --- a/backend/onyx/server/documents/standard_oauth.py +++ b/backend/onyx/server/documents/standard_oauth.py @@ -179,12 +179,10 @@ def oauth_callback( db_session=db_session, ) + # TODO: use a library for url handling + sep = "&" if "?" in desired_return_url else "?" return CallbackResponse( - redirect_url=( - f"{desired_return_url}?credentialId={credential.id}" - if "?" not in desired_return_url - else f"{desired_return_url}&credentialId={credential.id}" - ) + redirect_url=f"{desired_return_url}{sep}credentialId={credential.id}" ) diff --git a/web/src/app/admin/connectors/[connector]/AddConnectorPage.tsx b/web/src/app/admin/connectors/[connector]/AddConnectorPage.tsx index f07738d3a601..8b05b87d431b 100644 --- a/web/src/app/admin/connectors/[connector]/AddConnectorPage.tsx +++ b/web/src/app/admin/connectors/[connector]/AddConnectorPage.tsx @@ -18,7 +18,11 @@ import AdvancedFormPage from "./pages/Advanced"; import DynamicConnectionForm from "./pages/DynamicConnectorCreationForm"; import CreateCredential from "@/components/credentials/actions/CreateCredential"; import ModifyCredential from "@/components/credentials/actions/ModifyCredential"; -import { ConfigurableSources, oauthSupportedSources } from "@/lib/types"; +import { + ConfigurableSources, + oauthSupportedSources, + ValidSources, +} from "@/lib/types"; import { Credential, credentialTemplates, @@ -444,7 +448,7 @@ export default function AddConnector({ Select a credential - {connector == "gmail" ? ( + {connector == ValidSources.Gmail ? ( ) : ( <> diff --git a/web/src/lib/connectors/connectors.tsx b/web/src/lib/connectors/connectors.tsx index 71531046874f..2478e78560fc 100644 --- a/web/src/lib/connectors/connectors.tsx +++ b/web/src/lib/connectors/connectors.tsx @@ -772,7 +772,7 @@ For example, specifying .*-support.* as a "channel" will cause the connector to advanced_values: [], }, linear: { - description: "Configure Dropbox connector", + description: "Configure Linear connector", values: [], advanced_values: [], }, diff --git a/web/src/lib/connectors/credentials.ts b/web/src/lib/connectors/credentials.ts index bd9c5dfc8568..b32d9b54dce0 100644 --- a/web/src/lib/connectors/credentials.ts +++ b/web/src/lib/connectors/credentials.ts @@ -114,7 +114,7 @@ export interface LoopioCredentialJson { } export interface LinearCredentialJson { - linear_api_key: string; + linear_access_token: string; } export interface HubSpotCredentialJson { @@ -250,7 +250,7 @@ export const credentialTemplates: Record = { gong_access_key_secret: "", } as GongCredentialJson, zulip: { zuliprc_content: "" } as ZulipCredentialJson, - linear: { linear_api_key: "" } as LinearCredentialJson, + linear: { linear_access_token: "" } as LinearCredentialJson, hubspot: { hubspot_access_token: "" } as HubSpotCredentialJson, document360: { portal_id: "", @@ -404,7 +404,7 @@ export const credentialDisplayNames: Record = { loopio_client_token: "Loopio Client Token", // Linear - linear_api_key: "Linear API Key", + linear_access_token: "Linear Access Token", // HubSpot hubspot_access_token: "HubSpot Access Token",