【发布时间】:2015-07-15 09:23:41
【问题描述】:
使用以下@NodeEntity
@NodeEntity
public class Person extends BasePersistenceObject {
@GraphId
Long id;
String fullName;
@Indexed(unique=true)
String email;
String passwordHash = null;
@JsonIgnore
public String getPasswordHash() {
return passwordHash;
}
...
}
我仍然在以下控制器方法的 JSON 响应中看到 passwordHash:
@RequestMapping(value = "/login", method=RequestMethod.POST)
public @ResponseBody Person login(@RequestBody Map<String, String> credentials, HttpServletRequest request) throws AuthorizationException {
String email = credentials.get("email");
String password = credentials.get("password");
String ipAddress = request.getRemoteAddr();
return authService.authenticate(email, password, ipAddress);
}
【问题讨论】:
-
@cybersam - 不是重复的。我正在使用正确的导入。
-
您是否尝试在密码哈希字段中添加
@JsonIgnore?
标签: java spring neo4j spring-data-neo4j