forked from github/plane
fix: environment config changes in the API are replicated in web and space app (#2699)
* fix: envconfig type changes * chore: configuration variables (#2692) * chore: update avatar group logic (#2672) * chore: configuration variables --------- * fix: replacing slack client id with env config --------- Co-authored-by: Nikhil <118773738+pablohashescobar@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
1986c0dfd4
commit
26de35bd8d
@@ -1,23 +1,26 @@
|
||||
import { useRef, useState } from "react";
|
||||
|
||||
import { useRouter } from "next/router";
|
||||
|
||||
const useIntegrationPopup = (provider: string | undefined, stateParams?: string) => {
|
||||
const useIntegrationPopup = ({
|
||||
provider,
|
||||
stateParams,
|
||||
github_app_name,
|
||||
slack_client_id,
|
||||
}: {
|
||||
provider: string | undefined;
|
||||
stateParams?: string;
|
||||
github_app_name?: string;
|
||||
slack_client_id?: string;
|
||||
}) => {
|
||||
const [authLoader, setAuthLoader] = useState(false);
|
||||
|
||||
const router = useRouter();
|
||||
const { workspaceSlug, projectId } = router.query;
|
||||
|
||||
const providerUrls: { [key: string]: string } = {
|
||||
github: `https://github.com/apps/${
|
||||
process.env.NEXT_PUBLIC_GITHUB_APP_NAME
|
||||
}/installations/new?state=${workspaceSlug?.toString()}`,
|
||||
slack: `https://slack.com/oauth/v2/authorize?scope=chat:write,im:history,im:write,links:read,links:write,users:read,users:read.email&user_scope=&&client_id=${
|
||||
process.env.NEXT_PUBLIC_SLACK_CLIENT_ID
|
||||
}&state=${workspaceSlug?.toString()}`,
|
||||
slackChannel: `https://slack.com/oauth/v2/authorize?scope=incoming-webhook&client_id=${
|
||||
process.env.NEXT_PUBLIC_SLACK_CLIENT_ID
|
||||
}&state=${workspaceSlug?.toString()},${projectId?.toString()}${
|
||||
github: `https://github.com/apps/${github_app_name}/installations/new?state=${workspaceSlug?.toString()}`,
|
||||
slack: `https://slack.com/oauth/v2/authorize?scope=chat:write,im:history,im:write,links:read,links:write,users:read,users:read.email&user_scope=&&client_id=${slack_client_id}&state=${workspaceSlug?.toString()}`,
|
||||
slackChannel: `https://slack.com/oauth/v2/authorize?scope=incoming-webhook&client_id=${slack_client_id}&state=${workspaceSlug?.toString()},${projectId?.toString()}${
|
||||
stateParams ? "," + stateParams : ""
|
||||
}`,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user