ZhuDongming
2019-09-04 379c55655ef027effbc3fa62b2719b0e9158f0c6
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.")
                );