diff --git a/src/Services/PostService.php b/src/Services/PostService.php index eed27e86..4edbf48b 100644 --- a/src/Services/PostService.php +++ b/src/Services/PostService.php @@ -109,10 +109,13 @@ class PostService { $formData->validate($this->validator); + if ($formData->anonymous) + $this->authService->loginAnonymous(); + $post = new Post(); $post->setUploadTime($this->timeService->getCurrentTime()); $post->setLastEditTime($this->timeService->getCurrentTime()); - $post->setUser($formData->anonymous ? null : $this->authService->getLoggedInUser()); + $post->setUser($this->authService->getLoggedInUser()); $post->setOriginalFileName($formData->contentFileName); $post->setName($this->getUniqueRandomPostName());