/// <summary> /// Извлекает токен из хранилища, если он есть /// </summary> /// <param name="context"></param> /// <returns></returns> public async Task ReceiveAsync(AuthenticationTokenReceiveContext context) { Log.Information("LCManagerAPI. ReceiveAsync start.{token}", context.Token); if (_tokenService.ReceiveRefreshTokenForManager(context.Token)) { Log.Information("LCManagerAPI. Токен {token} найден в БД", context.Token); AuthenticationTicket ticket; if (_refreshTokens.TryRemove(context.Token, out ticket)) { Log.Information("LCManagerAPI. Токен {token} извлечен из словаря ", context.Token); context.SetTicket(ticket); } else { Log.Information("LCManagerAPI. Токенов в словаре {count} ", _refreshTokens.Count()); Log.Information("LCManagerAPI. Наличие токена {token} в словаре = {state}", context.Token, _refreshTokens.Any(x => x.Key == context.Token)); } } }