public static UserAuthentication checkIfActive ( UserAuthentication userAuth , User user , boolean throwException ) { if ( userAuth == null || user == null || user . getIdentifier ( ) == null ) { if ( throwException ) { throw new BadCredentialsException ( "Bad credentials." ) ; } else { logger . debug ( "Bad credentials. {}" , userAuth ) ; return null ; } } else if ( ! user . getActive ( ) ) { if ( throwException ) { throw new LockedException ( "Account " + user . getId ( ) + " (" + user . getAppid ( ) + "/" + user . getIdentifier ( ) + ") is locked." ) ; } else { logger . warn ( "Account {} ({}/{}) is locked." , user . getId ( ) , user . getAppid ( ) , user . getIdentifier ( ) ) ; return null ; } } return userAuth ; }
Checks if account is active .