Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Identity/EntityFrameworkCore/src/UserOnlyStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,7 @@ public virtual async Task<IList<UserPasskeyInfo>> GetPasskeysAsync(TUser user, C
cancellationToken.ThrowIfCancellationRequested();
ThrowIfDisposed();
ArgumentNullException.ThrowIfNull(user);
ArgumentNullException.ThrowIfNull(credentialId);

var passkey = await FindUserPasskeyAsync(user.Id, credentialId, cancellationToken).ConfigureAwait(false);
if (passkey != null)
Expand Down
2 changes: 2 additions & 0 deletions src/Identity/EntityFrameworkCore/src/UserStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,7 @@ public virtual async Task AddOrUpdatePasskeyAsync(TUser user, UserPasskeyInfo pa
var userPasskey = await FindUserPasskeyByIdAsync(passkey.CredentialId, cancellationToken).ConfigureAwait(false);
if (userPasskey != null)
{
userPasskey.Data.Name = passkey.Name;
userPasskey.Data.SignCount = passkey.SignCount;
userPasskey.Data.IsBackedUp = passkey.IsBackedUp;
userPasskey.Data.IsUserVerified = passkey.IsUserVerified;
Expand Down Expand Up @@ -851,6 +852,7 @@ public virtual async Task<IList<UserPasskeyInfo>> GetPasskeysAsync(TUser user, C
{
cancellationToken.ThrowIfCancellationRequested();
ThrowIfDisposed();
ArgumentNullException.ThrowIfNull(user);
ArgumentNullException.ThrowIfNull(credentialId);

var passkey = await FindUserPasskeyAsync(user.Id, credentialId, cancellationToken).ConfigureAwait(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ protected virtual void SetupAddIdentity(IServiceCollection services)
options.Password.RequireNonAlphanumeric = false;
options.Password.RequireUppercase = false;
options.User.AllowedUserNameCharacters = null;
options.Stores.SchemaVersion = IdentitySchemaVersions.Version3;
})
.AddRoles<TRole>()
.AddDefaultTokenProviders()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ protected override void SetupAddIdentity(IServiceCollection services)
options.Password.RequireNonAlphanumeric = false;
options.Password.RequireUppercase = false;
options.User.AllowedUserNameCharacters = null;
options.Stores.SchemaVersion = IdentitySchemaVersions.Version3;
})
.AddDefaultTokenProviders()
.AddEntityFrameworkStores<TestDbContext>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@ public void CanCreateUserUsingEF()

private IdentityDbContext CreateContext()
{
var db = DbUtil.Create<IdentityDbContext>(_fixture.Connection);
var services = new ServiceCollection();
services.Configure<IdentityOptions>(options =>
{
options.Stores.SchemaVersion = IdentitySchemaVersions.Version3;
});
var db = DbUtil.Create<IdentityDbContext>(_fixture.Connection, services);
db.Database.EnsureCreated();
return db;
}
Expand Down Expand Up @@ -195,7 +200,6 @@ public async Task FindByEmailThrowsWithTwoUsersWithSameEmail()
userB.Email = "[email protected]";
IdentityResultAssert.IsSuccess(await manager.CreateAsync(userB, "password"));
await Assert.ThrowsAsync<InvalidOperationException>(async () => await manager.FindByEmailAsync("[email protected]"));

}

[ConditionalFact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ public UserStoreWithGenericsTest(ScratchDatabaseFixture fixture)

private ContextWithGenerics CreateContext()
{
var db = DbUtil.Create<ContextWithGenerics>(_fixture.Connection);
var services = new ServiceCollection();
services.Configure<IdentityOptions>(options =>
{
options.Stores.SchemaVersion = IdentitySchemaVersions.Version3;
});
var db = DbUtil.Create<ContextWithGenerics>(_fixture.Connection, services);
db.Database.EnsureCreated();
return db;
}
Expand Down
Loading
Loading