diff --git a/backend-services/feed-service/app/controllers/DailyController.scala b/backend-services/feed-service/app/controllers/DailyController.scala index 2ae8ee008eef2e63f94126cb0e0d0596864736ca..69c00c4eb94fdc9bd5328067d10ee3f2a19a9f86 100644 --- a/backend-services/feed-service/app/controllers/DailyController.scala +++ b/backend-services/feed-service/app/controllers/DailyController.scala @@ -5,6 +5,7 @@ import play.api.mvc._ import play.api.libs.json.{JsValue, JsLookupResult} import models.{Daily} +import models.actions.{AuthenticatedUserAction} import models.exceptions.{ConflictException, NotFoundException, InvalidRequestBodyException, InvalidQueryParameterException} import scala.concurrent.TimeoutException @@ -14,12 +15,13 @@ import org.bson.types.ObjectId * This controller handles all the Daily endpoints. */ @Singleton -class DailyController @Inject()(val controllerComponents: ControllerComponents) extends BaseController { +class DailyController @Inject()(val controllerComponents: ControllerComponents, authenticatedUserAction: AuthenticatedUserAction) + extends BaseController { /** * Create an Action to fetch all the Dailies in the DB. */ - def getAll() = Action { + def getAll() = authenticatedUserAction { println("DailyController:getAll") try { @@ -37,7 +39,7 @@ class DailyController @Inject()(val controllerComponents: ControllerComponents) * * @param userId The ID of the user to get the dailies for. */ - def getUserDailies(userId: String) = Action { + def getUserDailies(userId: String) = authenticatedUserAction { println("DailyController:getUserDailies") try { @@ -58,7 +60,7 @@ class DailyController @Inject()(val controllerComponents: ControllerComponents) * * @param userId The ID of the user to get the feed for. */ - def getUserFeed(userId: String) = Action { + def getUserFeed(userId: String) = authenticatedUserAction { println("DailyController:getUserFeed") try {