Ejemplo n.º 1
0
 public Result authUser() {
   Http.Cookie cookie = request().cookie(Constants.AuthTokenCookieKey);
   if (cookie != null) {
     User user = new User(3L, "*****@*****.**", "123456", "TestUser");
     return ok(Json.toJson(user));
   } else {
     ObjectNode node = Json.newObject();
     node.put("code", "UNAUTHORIZED");
     node.put("message", "Unauthorized");
     return Results.unauthorized(node);
   }
 }