From 8b068521c8ae6f81ef669add5bcf8655b9e733a0 Mon Sep 17 00:00:00 2001 From: Maxence Lange Date: Wed, 28 Nov 2018 10:15:25 -0100 Subject: [PATCH] return token on post creation Signed-off-by: Maxence Lange --- lib/Controller/LocalController.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/Controller/LocalController.php b/lib/Controller/LocalController.php index 997b12bb..b5216943 100644 --- a/lib/Controller/LocalController.php +++ b/lib/Controller/LocalController.php @@ -140,9 +140,14 @@ class LocalController extends Controller { $post->setType($this->get('type', $data, NoteService::TYPE_PUBLIC)); /** @var ACore $activity */ - $this->postService->createPost($post, $activity); + $token = $this->postService->createPost($post, $activity); - return $this->directSuccess($activity->getObject()); + return $this->success( + [ + 'post' => $activity->getObject(), + 'token' => $token + ] + ); } catch (Exception $e) { return $this->fail($e); }