Fixed login request validation

This commit is contained in:
Claudio Maggioni 2020-03-04 13:28:51 +01:00
parent 5a5cc2e013
commit d209586933

View file

@ -43,7 +43,8 @@ public class AuthenticationController {
}
@PostMapping("/login")
public JWTResponse login(@RequestBody JWTRequest authenticationRequest) throws Exception {
public JWTResponse login(@Valid @RequestBody JWTRequest authenticationRequest)
throws Exception {
if (authenticationRequest.getUsernameOrEmail().contains("@")) {
// usernameOrEmail contains an email, so fetch the corresponding username
final User user =