public async Task <bool> CacheSessionKeysAsync(string tokenId, string userId, string sessionId)
        {
            string key  = CacheKeyFactories.GenerateSessionKeyCache(userId, tokenId);
            var    data = await cacheDb.StringGetAsync(new RedisKey(key));

            var cacheModel = new SessionCacheKeyModel()
            {
                SessionId = sessionId,
                UserId    = userId
            };

            string json = JsonConvert.SerializeObject(cacheModel);

            if (data.HasValue)
            {
                await cacheDb.KeyDeleteAsync(new RedisKey(key));

                await cacheDb.StringSetAsync(new RedisKey(key), new RedisValue(json), TimeSpan.FromMinutes(authOptions.Value.AccessTokenLifeTime));

                return(true);
            }

            await cacheDb.StringSetAsync(new RedisKey(key), new RedisValue(json), TimeSpan.FromMinutes(authOptions.Value.AccessTokenLifeTime));

            return(true);
        }
        public async Task <SessionCacheKeyModel> GetSessionCacheKeyAsync(string userId, string tokenId)
        {
            try
            {
                string key    = CacheKeyFactories.GenerateSessionKeyCache(userId, tokenId);
                var    result = await cacheDb.StringGetAsync(new RedisKey(key));

                return(JsonConvert.DeserializeObject <SessionCacheKeyModel>(result));
            }
            catch (Exception ex)
            {
                Logger.ErrorLog(ex);
                return(null);
            }
        }