-
Notifications
You must be signed in to change notification settings - Fork 79
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
Search crawler not working after adding authentication in to my docs #105
Comments
Which version of node, docusaurus and docusaurus-lunr-search do you use? How do you implemented the authentication? Can you provide an example code/project? |
I encounted the same issue with docusaurus 3.0.1 and docusaurus-lunr-search 3.3.1, placed the authentication logic in src/theme/Root.js. The code is as follows. Thank you for any help.
|
@justCXQ My guess is that in your case the authentication code gets executed in the build process without a valid token, so ofc the access will be denied and the indexing fails. Take a look at Although this approach could work, for various security concerns I strongly advise implementing authentication before clients reach docusaurus: BasicAuth, ForwardAuth, ... Edit: Also #119 (comment) |
Also ran into this and the workaround in #119 (comment) worked great thanks @lxix - might be worth calling this out in the documentation or maybe a warn since all most will see is |
I have added the authentication to my docs. After that search is not working. Search files are empty in the build folder. Below are the build logs. Any help will be great Thanks!
docusaurus-lunr-search:: Building search docs and lunr index file
docusaurus-lunr-search:: Start scanning documents in 16 threads
docusaurus-lunr-search:: Indexing time: 309.268ms
docusaurus-lunr-search:: indexed 0 documents out of 90
docusaurus-lunr-search:: writing search-doc.json
docusaurus-lunr-search:: writing search-doc-1684321241892.json
docusaurus-lunr-search:: writing lunr-index.json
docusaurus-lunr-search:: writing lunr-index-1684321241892.json
docusaurus-lunr-search:: End of process
The text was updated successfully, but these errors were encountered: