- Used the work from @knight1219 (Daniel Mathews) as the basis.
* Fixed the unit tests so that they are now passing. Note: This is my first real introduction to Moq, so there are probably a few things that can be improved. Changes: * Had a few issues with the mock logger, ended up adding a LoggerFactory and Logger implementation to work around this issue (for some reason the mock logger was never called and the unit tests failed because the string builder was never updated). * Accommodated changes to the SignInManager, UserManager where the latest version has added Logging to constructor * SecurityStamp functions in UserManager now check for null and throws an exception, so the unit tests can no longer call GetSecurityStampAsync before its set. Line 866: https://github.com/dotnet/aspnetcore/blame/605c522fa3e875fd6d3aefa783a71d1745b7e4c7/src/Identity/Extensions.Core/src/UserManager.cs * SignInManager.RefreshSignInAsync has changed the internal method from s.SignInAsync to SignInWithClaimsAsync
This commit is contained in:
@@ -1,22 +1,22 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netcoreapp2.0;netstandard2.0</TargetFrameworks>
|
||||
<TargetFrameworks>netcoreapp3.1;netstandard2.1</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
||||
<DocumentationFile>bin\Release\netstandard2.0\AspNetCore.Identity.MongoDbCore.xml</DocumentationFile>
|
||||
<DocumentationFile>bin\Release\netstandard2.1\AspNetCore.Identity.MongoDbCore.xml</DocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<DocumentationFile>bin\Debug\netstandard2.0\AspNetCore.Identity.MongoDbCore.xml</DocumentationFile>
|
||||
<DocumentationFile>bin\Debug\netstandard2.1\AspNetCore.Identity.MongoDbCore.xml</DocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Identity" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Identity.Stores" Version="2.2.0" />
|
||||
<PackageReference Include="MongoDB.Driver" Version="2.7.0" />
|
||||
<PackageReference Include="MongoDbGenericRepository" Version="1.4.0" />
|
||||
<PackageReference Include="Microsoft.Extensions.Identity.Stores" Version="3.1.1" />
|
||||
<PackageReference Include="MongoDB.Driver" Version="2.10.1" />
|
||||
<PackageReference Include="MongoDbGenericRepository" Version="1.4.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -211,10 +211,13 @@ namespace AspNetCore.Identity.MongoDbCore
|
||||
var updateRes = await collection.ReplaceOneAsync(x => x.Id.Equals(user.Id)
|
||||
&& x.ConcurrencyStamp.Equals(oldStamp),
|
||||
user);
|
||||
|
||||
|
||||
if (updateRes.ModifiedCount == 0)
|
||||
{
|
||||
return IdentityResult.Failed(ErrorDescriber.ConcurrencyFailure());
|
||||
}
|
||||
|
||||
return IdentityResult.Success;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user