mirror of
https://gitee.com/jmix/cuba.git
synced 2024-12-04 20:28:00 +08:00
PL-9404 New Authentication subsystem
Check not null credentials argument
This commit is contained in:
parent
0e9dc819db
commit
23dff655e0
@ -39,6 +39,8 @@ import javax.persistence.NoResultException;
|
||||
import java.lang.reflect.UndeclaredThrowableException;
|
||||
import java.util.List;
|
||||
|
||||
import static com.haulmont.bali.util.Preconditions.checkNotNullArgument;
|
||||
|
||||
@Component(AuthenticationManager.NAME)
|
||||
public class AuthenticationManagerBean implements AuthenticationManager {
|
||||
|
||||
@ -61,6 +63,8 @@ public class AuthenticationManagerBean implements AuthenticationManager {
|
||||
@Override
|
||||
@Nonnull
|
||||
public AuthenticationDetails login(Credentials credentials) throws LoginException {
|
||||
checkNotNullArgument(credentials, "credentials should not be null");
|
||||
|
||||
AuthenticationDetails authenticationDetails = null;
|
||||
|
||||
try (Transaction tx = persistence.getTransaction()) {
|
||||
@ -100,6 +104,8 @@ public class AuthenticationManagerBean implements AuthenticationManager {
|
||||
@Override
|
||||
@Nonnull
|
||||
public AuthenticationDetails authenticate(Credentials credentials) throws LoginException {
|
||||
checkNotNullArgument(credentials, "credentials should not be null");
|
||||
|
||||
try (Transaction tx = persistence.getTransaction()) {
|
||||
AuthenticationDetails authenticationDetails = authenticateInternal(credentials);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user