Skip to content

Commit

Permalink
use token
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Jan 27, 2020
1 parent 7685129 commit c072143
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
3 changes: 2 additions & 1 deletion docs/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ module.exports = withTypescript({
const plugins = config.plugins.concat([
new webpack.DefinePlugin({
'process.env': {
LIB_VERSION: JSON.stringify(pkg.version),
ENABLE_AD: JSON.stringify(process.env.ENABLE_AD),
GITHUB_AUTH: JSON.stringify(process.env.GITHUB_AUTH),
LIB_VERSION: JSON.stringify(pkg.version),
REACT_MODE: JSON.stringify(reactMode),
},
}),
Expand Down
1 change: 1 addition & 0 deletions docs/pages/_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ function findActivePage(currentPages, pathname) {

function AppWrapper(props) {
const { children, pageProps } = props;

const router = useRouter();
const [redux] = React.useState(() => initRedux(pageProps.reduxServerState));

Expand Down
16 changes: 7 additions & 9 deletions docs/pages/versions.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,13 @@ export default function Page() {
}

async function getBranches() {
let branches = [];
try {
const result = await fetch('https://api.github.com/repos/mui-org/material-ui-docs/branches');
branches = await result.json();
} catch (err) {
// Swallow the exceptions.
}

branches = branches || [];
const result = await fetch('https://api.github.com/repos/mui-org/material-ui-docs/branches', {
headers: {
Authorization: `Basic ${Buffer.from(process.env.GITHUB_AUTH).toString('base64')}`,
},
});
// console.log('headers', result.headers);
const branches = await result.json();
return branches;
}

Expand Down
1 change: 0 additions & 1 deletion docs/src/pages/versions/StableVersions.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'isomorphic-fetch';
import React from 'react';
import PropTypes from 'prop-types';
import { withStyles } from '@material-ui/core/styles';
Expand Down

0 comments on commit c072143

Please sign in to comment.