public async Task <ActionResult> ResumeCurrentTrack() { try { var tokenGiven = _cookiesManager.GetCookie("TokenGiven", Request); var tokenTimes = _cookiesManager.GetCookie("TokenTime", Request); if (tokenGiven != null && tokenTimes != null) { if (ApiClientConfig.IsIfTokenExpired(Convert.ToDateTime(tokenTimes.Value), tokenGiven.Value)) { return(RedirectToAction("LoginUser")); } } else { return(RedirectToAction("LoginUser")); } client = ApiClientConfig.GetClientInstance(tokenGiven.Value); var tryResumeTrack = await _playerRepo.ResumeCurrentPlayBack(client); var modelValues = await GetPrivateUserDefaultModel(client); _model = modelValues; return(RedirectToAction("Index")); } catch (Exception ex) { ModelState.AddModelError(string.Empty, ex.Message); return(View(ERROR_MESSAGE_PATH)); } }