public RevolutApiClient(string endpoint, RefreshAccessTokenModel refreshAccessTokenModel, IMemoryCache memoryCache, HttpClient httpClient = null) { _memoryCache = memoryCache; _refreshAccessTokenModel = refreshAccessTokenModel; if (httpClient == null) { _httpClient = new HttpClient(); } else { _httpClient = httpClient; } _endpoint = endpoint; _jsonSerializerSettings = new JsonSerializerSettings { ContractResolver = new DefaultContractResolver { NamingStrategy = new SnakeCaseNamingStrategy() }, DateFormatString = "yyyy-MM-dd" }; }
public async Task <IActionResult> RefreshAccessToken(string refreshToken, RefreshAccessTokenModel model) => Ok(await _refreshTokenService.CreateAccessTokenAsync(model.Bind(m => m.Token, refreshToken).Token));