Revert "Revert "only authenticate for API requests and not documentation requests""

This reverts commit 554ba79e66a4bd372e0f3d17d7397759c01faeac.