Ability to copying authorization URL for Gmail (#375)

* Implemented copying auth URL for Gmail authentication.

* Update Button icon and add row spacing in Flyout grid

The icon used in the Button.Content has been updated to a new
design and is now wrapped inside a Viewbox with a width of 20
to ensure proper scaling. Additionally, the Grid inside the
Flyout now includes RowSpacing="12" to improve visual separation
between rows.
This commit is contained in:
Burak Kaan Köse
2024-09-14 01:17:03 +02:00
committed by GitHub
parent bf77572041
commit 9a44e30e0f
15 changed files with 159 additions and 24 deletions

View File

@@ -21,10 +21,21 @@ namespace Wino.Server.MessageHandlers
_authenticationProvider = authenticationProvider;
}
protected override async Task<WinoServerResponse<TokenInformation>> HandleAsync(AuthorizationRequested message, CancellationToken cancellationToken = default)
protected override async Task<WinoServerResponse<TokenInformation>> HandleAsync(AuthorizationRequested message,
CancellationToken cancellationToken = default)
{
var authenticator = _authenticationProvider.GetAuthenticator(message.MailProviderType);
// Some users are having issues with Gmail authentication.
// Their browsers may never launch to complete authentication.
// Offer to copy auth url for them to complete it manually.
// Redirection will occur to the app and the token will be saved.
if (message.ProposeCopyAuthorizationURL && authenticator is IGmailAuthenticator gmailAuthenticator)
{
gmailAuthenticator.ProposeCopyAuthURL = true;
}
// Do not save the token here. Call is coming from account creation and things are atomic there.
var generatedToken = await authenticator.GenerateTokenAsync(message.CreatedAccount, saveToken: false);

View File

@@ -42,7 +42,8 @@ namespace Wino.Server
IRecipient<RefreshUnreadCountsMessage>,
IRecipient<ServerTerminationModeChanged>,
IRecipient<AccountSynchronizationProgressUpdatedMessage>,
IRecipient<AccountFolderConfigurationUpdated>
IRecipient<AccountFolderConfigurationUpdated>,
IRecipient<CopyAuthURLRequested>
{
private readonly System.Timers.Timer _timer;
private static object connectionLock = new object();
@@ -139,6 +140,8 @@ namespace Wino.Server
public async void Receive(AccountFolderConfigurationUpdated message) => await SendMessageAsync(MessageType.UIMessage, message);
public async void Receive(CopyAuthURLRequested message) => await SendMessageAsync(MessageType.UIMessage, message);
#endregion
private string GetAppPackagFamilyName()