Outlook Auth Fix (#653)
Issue: Account selector dialog pops up endlessly for Outlook/Live accounts. (Stored account not being correctly identified) Fix: Ignore case differences, add null safety and remove whitespaces when retrieving stored accounts.
This commit is contained in:
@@ -67,7 +67,8 @@ public class OutlookAuthenticator : BaseAuthenticator, IOutlookAuthenticator
|
|||||||
{
|
{
|
||||||
await EnsureTokenCacheAttachedAsync();
|
await EnsureTokenCacheAttachedAsync();
|
||||||
|
|
||||||
var storedAccount = (await _publicClientApplication.GetAccountsAsync()).FirstOrDefault(a => a.Username == account.Address);
|
var storedAccount = (await _publicClientApplication.GetAccountsAsync()).FirstOrDefault(
|
||||||
|
a => string.Equals(a.Username?.Trim(), account.Address?.Trim(), StringComparison.OrdinalIgnoreCase));
|
||||||
|
|
||||||
if (storedAccount == null)
|
if (storedAccount == null)
|
||||||
return await GenerateTokenInformationAsync(account);
|
return await GenerateTokenInformationAsync(account);
|
||||||
|
|||||||
Reference in New Issue
Block a user