Canceling authentication and Outlook improvements (#367)

* Cancellation support for getting responses from the server.

* Adding cancel button for account creation dialog initialization.

* Prevent invalid outlook message types like contact, calendar event or todo item.

* Remove debug launcher options.
This commit is contained in:
Burak Kaan Köse
2024-09-13 02:51:37 +02:00
committed by GitHub
parent f85085de41
commit e93ecc7e4a
13 changed files with 112 additions and 66 deletions

View File

@@ -1,11 +1,12 @@
using Wino.Core.Domain.Enums;
using System.Threading;
using Wino.Core.Domain.Enums;
namespace Wino.Core.Domain.Interfaces
{
public interface IAccountCreationDialog
{
void ShowDialog();
void Complete();
void ShowDialog(CancellationTokenSource cancellationTokenSource);
void Complete(bool cancel);
AccountCreationDialogState State { get; set; }
}
}

View File

@@ -1,4 +1,5 @@
using System;
using System.Threading;
using System.Threading.Tasks;
using Wino.Core.Domain.Models.Authorization;
@@ -10,14 +11,14 @@ namespace Wino.Core.Domain.Interfaces
Task<string> GetMimeMessageStoragePath();
Task<string> GetEditorBundlePathAsync();
Task LaunchFileAsync(string filePath);
Task LaunchUriAsync(Uri uri);
Task<bool> LaunchUriAsync(Uri uri);
/// <summary>
/// Launches the default browser with the specified uri and waits for protocol activation to finish.
/// </summary>
/// <param name="authenticator"></param>
/// <returns>Response callback from the browser.</returns>
Task<Uri> GetAuthorizationResponseUriAsync(IAuthenticator authenticator, string authorizationUri);
Task<Uri> GetAuthorizationResponseUriAsync(IAuthenticator authenticator, string authorizationUri, CancellationToken cancellationToken = default);
/// <summary>
/// Finalizes GetAuthorizationResponseUriAsync for current IAuthenticator.

View File

@@ -1,4 +1,5 @@
using System;
using System.Threading;
using System.Threading.Tasks;
using Wino.Core.Domain.Enums;
using Wino.Core.Domain.Models.Server;
@@ -41,7 +42,7 @@ namespace Wino.Core.Domain.Interfaces
/// <typeparam name="TRequestType">Request type.</typeparam>
/// <param name="clientMessage">Request type.</param>
/// <returns>Response received from the server for the given TResponse type.</returns>
Task<WinoServerResponse<TResponse>> GetResponseAsync<TResponse, TRequestType>(TRequestType clientMessage) where TRequestType : IClientMessage;
Task<WinoServerResponse<TResponse>> GetResponseAsync<TResponse, TRequestType>(TRequestType clientMessage, CancellationToken cancellationToken = default) where TRequestType : IClientMessage;
/// <summary>
/// Handle for connecting to the server.