Add promoting/demoting user (change user role)

This commit is contained in:
Dmitrii Cravcenco
2023-12-12 10:18:50 +02:00
parent d03f3bd552
commit 7f0a173685
3 changed files with 43 additions and 7 deletions

View File

@@ -106,8 +106,6 @@ public class AuthenticationService {
.build();
}
public AuthenticationResponse authenticate(AuthenticationRequest request) {
authenticationManager.authenticate(new UsernamePasswordAuthenticationToken(request.getEmail(), request.getPassword()));
@@ -153,8 +151,7 @@ public class AuthenticationService {
updatedCredential.setPassword(passwordEncoder.encode(newPassword));
credentialRepository.save(updatedCredential);
}
}
} else throw new UserNotFoundException("User not found!");
}
}