docs: 🐛 another try with env variables

Signed-off-by: slumbering <slumbering.pierrot@gmail.com>
This commit is contained in:
slumbering 2021-06-14 14:42:41 +02:00
parent 5227b73771
commit 8b0f6535af
3 changed files with 8 additions and 4 deletions

View File

@ -58,6 +58,10 @@ module.exports = {
], ],
plugins: [ plugins: [
"docusaurus-plugin-sass", "docusaurus-plugin-sass",
"docusaurus2-dotenv" [
"docusaurus2-dotenv", {
systemvars: true,
},
]
], ],
}; };

View File

@ -25,8 +25,8 @@ async function getAccessToken(code) {
config: { config: {
params: { params: {
code, code,
client_id: 'cd8f9be2562bfc8d6cfc', client_id: process.env.REACT_APP_CLIENT_ID,
client_secret: '2509358055095d52dfd7331d072f378e7f16940f', client_secret: process.env.REACT_APP_CLIENT_SECRET,
}, },
errorMessage: 'error getAccessToken' errorMessage: 'error getAccessToken'
} }

View File

@ -139,7 +139,7 @@ function DocPage(props) {
); );
// CUSTOM DOCPAGE // 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 [isUserAuthorized, setIsUserAuthorized] = useState()
const [isLoading, setIsLoading] = useState(true) const [isLoading, setIsLoading] = useState(true)
const [redirectState, setRedirectState] = useState() const [redirectState, setRedirectState] = useState()