@Override
    public void clean() {
        try {
            val webAuthn = properties.getAuthn().getMfa().getWebAuthn().getCore();
            val expirationDate = LocalDate.now(ZoneOffset.UTC)
                .minus(webAuthn.getExpireDevices(), DateTimeUtils.toChronoUnit(webAuthn.getExpireDevicesTimeUnit()));
            LOGGER.debug("Filtering devices based on device expiration date [{}]", expirationDate);

            val expInstant = expirationDate.atStartOfDay(ZoneOffset.UTC).toInstant();
            val removingDevices = stream()
                .filter(Objects::nonNull)
                .filter(d -> d.getRegistrationTime() != null && d.getRegistrationTime().isBefore(expInstant)).toList();
            if (!removingDevices.isEmpty()) {
                LOGGER.debug("There are [{}] expired device(s) remaining in repository. Cleaning...", removingDevices.size());
                removingDevices.forEach(device -> removeRegistrationByUsername(device.getUsername(), device));
            }
        } catch (final Exception e) {
            LoggingUtils.error(LOGGER, e);
        }
    }
This is {@link BaseWebAuthnCredentialRepository}.

@author Misagh Moayyed
@since 6.3.0
support/cas-server-support-webauthn-core/src/main/java/org/apereo/cas/webauthn/storage/BaseWebAuthnCredentialRepository.java