diff --git a/LearningHub.Nhs.WebUI/Controllers/SearchController.cs b/LearningHub.Nhs.WebUI/Controllers/SearchController.cs index ac314f6c9..4f4e07e62 100644 --- a/LearningHub.Nhs.WebUI/Controllers/SearchController.cs +++ b/LearningHub.Nhs.WebUI/Controllers/SearchController.cs @@ -306,6 +306,11 @@ public async Task Image(string name) public async Task GetAutoSuggestion(string term) { var autoSuggestions = await this.searchService.GetAutoSuggestionList(term); + if (!this.User.Identity.IsAuthenticated) + { + return this.RedirectToAction("AccessDenied", "Home"); + } + return this.PartialView("_AutoComplete", autoSuggestions); } }