/// <summary> /// Clears the session’s HTTP authentication cache. /// </summary> /// <param name="options"></param> /// <returns></returns> public Task ClearAuthCacheAsync(RemovePassword options) { var taskCompletionSource = new TaskCompletionSource <object>(); string guid = Guid.NewGuid().ToString(); BridgeConnector.Socket.On("webContents-session-clearAuthCache-completed" + guid, () => { BridgeConnector.Socket.Off("webContents-session-clearAuthCache-completed" + guid); taskCompletionSource.SetResult(null); }); BridgeConnector.Socket.Emit("webContents-session-clearAuthCache", Id, JObject.FromObject(options, _jsonSerializer), guid); return(taskCompletionSource.Task); }
/// <summary> /// Clears the session’s HTTP authentication cache. /// </summary> /// <param name="options"></param> /// <returns></returns> public Task ClearAuthCacheAsync(RemovePassword options) { var taskCompletionSource = new TaskCompletionSource <object>(TaskCreationOptions.RunContinuationsAsynchronously); string guid = Guid.NewGuid().ToString(); BridgeConnector.On("webContents-session-clearAuthCache-completed" + guid, () => { BridgeConnector.Off("webContents-session-clearAuthCache-completed" + guid); taskCompletionSource.SetResult(null); }); BridgeConnector.Emit("webContents-session-clearAuthCache", Id, options, guid); return(taskCompletionSource.Task); }