-
-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't parse document when auth is added in Root.js #187
Comments
+1 |
+1 running into this as well (trying to swizzle Root) to add authentication layer. |
I ran into this issue as well, what ended up working for me was swizzling the Layout component and putting my authentication logic within the |
I ended up going with a different Docusaurus plugin, which still had a similar issue (it wouldn't index anything but ran fine). So I essentially created a check within the Root component that looked for an environment variable to be set to disable auth that I utilized during build to index .. copied/pasted index files out .. rebuild with authentication and copy index files back in. It's not great, but it worked :) in case anyone else was considering this approach. Be sure to consider the risks involved if you accidentally break authentication of your site during deploy. Sounds like the option above is a better idea. I might migrate to it to avoid the workaround I built. |
Thanks for your answer |
any updates? |
If I add an auth in src/theme/Root.js, search-local can't parse meta data:
src/theme/Root.js:
Could I first build the index in dev env without authentification and then build in prod and use the index generated previously?
Thanks,
The text was updated successfully, but these errors were encountered: