ZhuDongming
2019-08-15 f1c8a918c9e5ff4c91748269ae837d8f17c28511
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.")
                );