ZhuDongming
2019-09-04 b96cdf306e9124f93e5ca33e006728a2f4552c4d
src/main/java/com/moral/security/auth/login/LoginAuthenticationProvider.java
@@ -54,7 +54,7 @@
        String password = (String) authentication.getCredentials();
        LoginMode mode = (LoginMode) authentication.getDetails();
        Account account = accountService.queryAccountByName(accountName).orElseThrow(() -> new UsernameNotFoundException("User not found: " + accountName));
        Date expireTime = Optional.of(account.getExpireTime())
        Date expireTime = Optional.ofNullable(account.getExpireTime())
                .orElseThrow(
        ()-> new AccountExpiredBadCredentialsException("Authentication Failed. Account has expired.")
                );