aboutsummaryrefslogtreecommitdiff
path: root/juick-api/src/main/java/com/juick/api
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2017-10-22 15:39:17 +0300
committerGravatar Vitaly Takmazov2017-10-22 15:39:17 +0300
commit5f3cfe57e4a70cb56f8984e962a5217465da4b92 (patch)
tree9e01e6bab0e104690ac2f0cedf348e48cb6a9a21 /juick-api/src/main/java/com/juick/api
parentdd4fd097e298756a8941bd0f90dc6781588350b0 (diff)
api: /users without params now return current authenticated user
Diffstat (limited to 'juick-api/src/main/java/com/juick/api')
-rw-r--r--juick-api/src/main/java/com/juick/api/controllers/Users.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/juick-api/src/main/java/com/juick/api/controllers/Users.java b/juick-api/src/main/java/com/juick/api/controllers/Users.java
index 4881d841..dc8ebc84 100644
--- a/juick-api/src/main/java/com/juick/api/controllers/Users.java
+++ b/juick-api/src/main/java/com/juick/api/controllers/Users.java
@@ -28,6 +28,7 @@ import org.springframework.web.bind.annotation.*;
import javax.inject.Inject;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
/**
@@ -65,6 +66,9 @@ public class Users {
if (!users.isEmpty())
return users;
+ if (!UserUtils.getCurrentUser().isAnonymous()) {
+ return Collections.singletonList(UserUtils.getCurrentUser());
+ }
throw new HttpNotFoundException();
}