Skip to content

Commit fd99dfc

Browse files
Richasymichael-hawker
authored andcommitted
Update code
1 parent 9803019 commit fd99dfc

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

CommunityToolkit.Authentication.Uwp/WindowsProvider.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
using System;
66
using System.Collections.Generic;
7-
using System.Linq;
87
using System.Net.Http;
98
using System.Net.Http.Headers;
109
using System.Threading;
@@ -34,7 +33,7 @@ public class WindowsProvider : BaseProvider
3433
private const string SettingsKeyProviderId = "WindowsProvider_ProviderId";
3534
private const string SettingsKeyProviderAuthority = "WindowsProvider_Authority";
3635

37-
private static readonly SemaphoreSlim SemaphoreSlim = new(1);
36+
private static readonly SemaphoreSlim SemaphoreSlim = new (1);
3837

3938
// Default/minimal scopes for authentication, if none are provided.
4039
private static readonly string[] DefaultScopes = { "User.Read" };
@@ -503,7 +502,6 @@ async void OnAccountCommandsRequested(AccountsSettingsPane sender, AccountsSetti
503502
}
504503
}
505504
}
506-
catch (Exception ex)
507505
{
508506
webAccountProviderTaskCompletionSource.SetException(ex);
509507
}
@@ -573,6 +571,11 @@ private async Task<List<WebAccountProvider>> GetWebAccountProvidersAsync()
573571
await FindAndAddProviderAsync(MicrosoftProviderId, AadAuthority);
574572
}
575573

574+
if (_webAccountProviderConfig.WebAccountProviderType == WebAccountProviderType.Local)
575+
{
576+
await FindAndAddProviderAsync(LocalProviderId);
577+
}
578+
576579
return providers;
577580

578581
async Task FindAndAddProviderAsync(

0 commit comments

Comments
 (0)