Skip to content

Commit

Permalink
Allow comparison of username or email for login until Microsoft fixes…
Browse files Browse the repository at this point in the history
… the following.

dotnet/aspnetcore#44660
  • Loading branch information
etriebe committed Aug 27, 2024
1 parent 623179f commit 766d724
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions AspNetCore.Identity.CosmosDb/Stores/CosmosUserStore.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
using AspNetCore.Identity.CosmosDb.Contracts;
using AspNetCore.Identity.CosmosDb.Repositories;
using IdentityModel;
using Microsoft.AspNetCore.Identity;
using Microsoft.Azure.Cosmos;
using Microsoft.Azure.Cosmos.Serialization.HybridRow;
using Microsoft.EntityFrameworkCore;
using System;
using System.Buffers.Text;
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using System.Security.Cryptography;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

Expand Down Expand Up @@ -186,7 +180,7 @@ public async Task<TUserEntity> FindByNameAsync(string normalizedUserName,
throw new ArgumentNullException(nameof(normalizedUserName));

return await _repo.Table<TUserEntity>()
.SingleOrDefaultAsync(_ => _.NormalizedUserName == normalizedUserName);
.SingleOrDefaultAsync(_ => _.NormalizedUserName == normalizedUserName || _.NormalizedEmail == normalizedUserName);
}

// <inheritdoc />
Expand Down

0 comments on commit 766d724

Please sign in to comment.