diff --git a/ref/WTTS.MicroServices.ClientSDK b/ref/WTTS.MicroServices.ClientSDK index 0f04842586c..d38c205b170 160000 --- a/ref/WTTS.MicroServices.ClientSDK +++ b/ref/WTTS.MicroServices.ClientSDK @@ -1 +1 @@ -Subproject commit 0f04842586c2f7a6517ad24f22ec1f9736756ed8 +Subproject commit d38c205b1701e8f40747ba4d46a96d65be864c9b diff --git a/src/BD.WTTS.Client.Avalonia/UI/Views/Pages/User/LoginOrRegisterPage.axaml.cs b/src/BD.WTTS.Client.Avalonia/UI/Views/Pages/User/LoginOrRegisterPage.axaml.cs index be3ac8f0588..ab1a1cd6e09 100644 --- a/src/BD.WTTS.Client.Avalonia/UI/Views/Pages/User/LoginOrRegisterPage.axaml.cs +++ b/src/BD.WTTS.Client.Avalonia/UI/Views/Pages/User/LoginOrRegisterPage.axaml.cs @@ -45,6 +45,17 @@ protected override void OnLoaded(RoutedEventArgs e) this.ViewModel.Close(); } } + Application.Current!.UrlsOpened += Current_UrlsOpened; + } + + private async void Current_UrlsOpened(object? sender, UrlOpenedEventArgs e) + { + var loginUrl = e.Urls.Where(x => x.StartsWith(Constants.UrlSchemes.Login)).FirstOrDefault(); + if (loginUrl != null) + { + var token = loginUrl.Substring(Constants.UrlSchemes.Login.Length, loginUrl.Length - 1); + await ThirdPartyLoginHelper.OnMessageAsync(token); + } } protected override void OnDataContextChanged(EventArgs e) @@ -64,5 +75,6 @@ protected override void OnDetachedFromVisualTree(VisualTreeAttachmentEventArgs e { vm.RemoveAllDelegate(); } + Application.Current!.UrlsOpened -= Current_UrlsOpened; } }