Merge branch '16-no-validation-on-login-route-causes-nullpointer' into 'dev'
Resolve "No validation on login route causes NullPointer" Closes #16 See merge request sa4-2020/the-sanmarinoes/backend!21
This commit is contained in:
commit
b6add2aaf6
1 changed files with 2 additions and 1 deletions
|
@ -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 =
|
||||
|
|
Loading…
Reference in a new issue