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:
@@ -3,6 +3,7 @@ using System.Net.Http;
|
||||
using System.Text;
|
||||
using System.Text.Json.Nodes;
|
||||
using System.Threading.Tasks;
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
using Wino.Core.Domain;
|
||||
using Wino.Core.Domain.Entities;
|
||||
using Wino.Core.Domain.Enums;
|
||||
@@ -11,6 +12,7 @@ using Wino.Core.Domain.Interfaces;
|
||||
using Wino.Core.Domain.Models.Authentication;
|
||||
using Wino.Core.Domain.Models.Authorization;
|
||||
using Wino.Core.Services;
|
||||
using Wino.Messaging.Server;
|
||||
|
||||
namespace Wino.Core.Authenticators
|
||||
{
|
||||
@@ -24,6 +26,8 @@ namespace Wino.Core.Authenticators
|
||||
|
||||
public override MailProviderType ProviderType => MailProviderType.Gmail;
|
||||
|
||||
public bool ProposeCopyAuthURL { get; set; }
|
||||
|
||||
private readonly INativeAppService _nativeAppService;
|
||||
|
||||
public GmailAuthenticator(ITokenService tokenService, INativeAppService nativeAppService) : base(tokenService)
|
||||
@@ -121,6 +125,11 @@ namespace Wino.Core.Authenticators
|
||||
|
||||
Uri responseRedirectUri = null;
|
||||
|
||||
if (ProposeCopyAuthURL)
|
||||
{
|
||||
WeakReferenceMessenger.Default.Send(new CopyAuthURLRequested(authorizationUri));
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
responseRedirectUri = await _nativeAppService.GetAuthorizationResponseUriAsync(this, authorizationUri);
|
||||
|
||||
Reference in New Issue
Block a user