Open biboc opened 1 year ago
+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 <LayoutProvider>
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
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
<LayoutProvider>
Thanks for your answer Can you share your code?
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,