private async void DeleteToken() { var tokenEntity = await _accessTokenRepository.GetAccessToken(); try { _accessTokenRepository.DeleteToken(tokenEntity); } catch (Exception ex) { _logger.LogError("Deleting an old access token failed.", ex); } }
public void StoreAccessToken(JsonWebToken token, int userId) { if (token != null || userId > 0) { var aToken = _tokenRepo.GetAccessToken(userId); if (aToken != null) { _tokenRepo.DeleteToken(aToken); } _tokenRepo.StoreAccessToken(token, userId); } }