From 8b0f6535af8104d38f9733311f4c9b615d3394ac Mon Sep 17 00:00:00 2001 From: slumbering Date: Mon, 14 Jun 2021 14:42:41 +0200 Subject: [PATCH] docs: :bug: another try with env variables Signed-off-by: slumbering --- website/docusaurus.config.js | 6 +++++- website/src/api/github.js | 4 ++-- website/src/theme/DocPage/index.js | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/website/docusaurus.config.js b/website/docusaurus.config.js index 61866f85..8bb3474f 100644 --- a/website/docusaurus.config.js +++ b/website/docusaurus.config.js @@ -58,6 +58,10 @@ module.exports = { ], plugins: [ "docusaurus-plugin-sass", - "docusaurus2-dotenv" + [ + "docusaurus2-dotenv", { + systemvars: true, + }, + ] ], }; diff --git a/website/src/api/github.js b/website/src/api/github.js index ce2b66df..d95064c9 100644 --- a/website/src/api/github.js +++ b/website/src/api/github.js @@ -25,8 +25,8 @@ async function getAccessToken(code) { config: { params: { code, - client_id: 'cd8f9be2562bfc8d6cfc', - client_secret: '2509358055095d52dfd7331d072f378e7f16940f', + client_id: process.env.REACT_APP_CLIENT_ID, + client_secret: process.env.REACT_APP_CLIENT_SECRET, }, errorMessage: 'error getAccessToken' } diff --git a/website/src/theme/DocPage/index.js b/website/src/theme/DocPage/index.js index 7f9d8c50..6d0e9b20 100644 --- a/website/src/theme/DocPage/index.js +++ b/website/src/theme/DocPage/index.js @@ -139,7 +139,7 @@ function DocPage(props) { ); // CUSTOM DOCPAGE - if (typeof window !== "undefined" && window?.location?.hostname !== "localhost") { + if (typeof window === "undefined" || (typeof window !== "undefined" && window?.location?.hostname !== "localhost")) { const [isUserAuthorized, setIsUserAuthorized] = useState() const [isLoading, setIsLoading] = useState(true) const [redirectState, setRedirectState] = useState()