41 lines
1.1 KiB
JavaScript
41 lines
1.1 KiB
JavaScript
import Document, { Html, Head, Main, NextScript } from "next/document";
|
|
import SkipLink from "../components/skiplink";
|
|
//import basicAuthMiddleware from "nextjs-basic-auth-middleware";
|
|
|
|
class MyDocument extends Document {
|
|
// static async getInitialProps(ctx) {
|
|
// const initialProps = await Document.getInitialProps(ctx);
|
|
// if (ctx.req && ctx.res) {
|
|
// await basicAuthMiddleware(ctx.req, ctx.res, {
|
|
// users: [
|
|
// {
|
|
// name: "rehab",
|
|
// password: "preventTesting",
|
|
// },
|
|
// ],
|
|
// });
|
|
// }
|
|
// return { ...initialProps };
|
|
// }
|
|
|
|
render() {
|
|
return (
|
|
<Html lang="en">
|
|
<Head />
|
|
<body>
|
|
{!process.browser && (
|
|
<script>
|
|
window.apiRoot = `{process.env.API_ROOT}`
|
|
</script>
|
|
)}
|
|
<SkipLink />
|
|
<Main />
|
|
<NextScript />
|
|
</body>
|
|
</Html>
|
|
);
|
|
}
|
|
}
|
|
|
|
export default MyDocument;
|