fengxiang
2018-08-17 2d0b1b3da347f201cfe608e426fb2b7fdb9629a7
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.")
                );