aboutsummaryrefslogtreecommitdiff
path: root/juick-api/src/main
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2017-10-13 11:46:09 +0300
committerGravatar Vitaly Takmazov2017-10-13 11:46:09 +0300
commitffe9ea5db1956ab7570d467ce8388aac8a474fe0 (patch)
treeb1557ca7f1a5dbf440b7e72c73b34730b37ddc63 /juick-api/src/main
parent5439a0fa2fd0d778561e20f089af7dd9de7a5511 (diff)
api: /auth
Diffstat (limited to 'juick-api/src/main')
-rw-r--r--juick-api/src/main/java/com/juick/api/controllers/Users.java10
1 files changed, 6 insertions, 4 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 35bd229b..4881d841 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
@@ -24,10 +24,7 @@ import com.juick.service.UserService;
import com.juick.server.util.UserUtils;
import com.juick.server.util.WebUtils;
import org.springframework.http.MediaType;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
import javax.inject.Inject;
import java.util.ArrayList;
@@ -41,6 +38,11 @@ public class Users {
@Inject
private UserService userService;
+ @RequestMapping(value = "/auth", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+ public String getAuthToken() {
+ return userService.getHashByUID(UserUtils.getCurrentUser().getUid());
+ }
+
@RequestMapping(value = "/users", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public List<User> doGetUsers(
@RequestParam(value = "uname", required = false) List<String> unames,