@Override
    public OneTimeTokenAccount update(final OneTimeTokenAccount account) {
        val encodedAccount = encode(account);

        val redisAccountKey = RedisCompositeKey.forAccounts().withAccount(encodedAccount).toKeyPattern();
        LOGGER.trace("Saving account [{}] using key [{}]", encodedAccount, redisAccountKey);
        casRedisTemplates.getAccountsRedisTemplate().boundValueOps(redisAccountKey).set(account);

        val redisPrincipalKey = RedisCompositeKey.forPrincipals().withPrincipal(encodedAccount).toKeyPattern();
        LOGGER.trace("Saving principal [{}] using key [{}]", encodedAccount, redisPrincipalKey);
        casRedisTemplates.getPrincipalsRedisTemplate().boundSetOps(redisPrincipalKey).add(encodedAccount);

        return encodedAccount;
    }
This is {@link RedisGoogleAuthenticatorTokenCredentialRepository}.

@author Misagh Moayyed
@since 6.1.0
support/cas-server-support-gauth-redis/src/main/java/org/apereo/cas/gauth/credential/RedisGoogleAuthenticatorTokenCredentialRepository.java