ZhuDongming
2019-08-08 90a6386cda8e3356c23f283656bf94e21e94b46a
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.")
                );