Update README.md
This commit is contained in:
committed by
GitHub
parent
0ebee24219
commit
5ed5778e4f
@@ -33,7 +33,7 @@ Here is an example:
|
||||
}
|
||||
}
|
||||
```
|
||||
The Id field is automatically set at instanciation, this also applies to users inheriting from MongoIdentityUser<int>, where a random integer is assigned to the Id. It is however not advised to rely on such random mechanism to set the primary key of your document. Using documents inheriting from `MongoIdentityRole<Guid>` is recommended.
|
||||
The `Id` field is automatically set at instanciation, this also applies to users inheriting from `MongoIdentityUser<int>`, where a random integer is assigned to the `Id`. It is however not advised to rely on such random mechanism to set the primary key of your document. Using documents inheriting from `MongoIdentityRole<Guid>` is recommended.
|
||||
|
||||
The configuration is done by populating a `MongoDbIdentityConfiguration` object, which can have an `IdentityOptionsAction` property set to an action you want to perform against the `IdentityOptions` (`Action<IdentityOptions>`).
|
||||
|
||||
@@ -60,6 +60,7 @@ The MongoDb connection is managed using the [mongodb-generic-repository](https:/
|
||||
|
||||
// add a global config object
|
||||
services.AddSingleton(Configuration);
|
||||
// get the MongoDb settings from the Configuration object.
|
||||
var settings = Configuration.GetSection(nameof(MongoDbSettings)).Get<MongoDbSettings>();
|
||||
var mongoDbIdentityConfiguration = new MongoDbIdentityConfiguration
|
||||
{
|
||||
@@ -76,7 +77,6 @@ The MongoDb connection is managed using the [mongodb-generic-repository](https:/
|
||||
options.Lockout.DefaultLockoutTimeSpan = TimeSpan.FromMinutes(30);
|
||||
options.Lockout.MaxFailedAccessAttempts = 10;
|
||||
|
||||
|
||||
// ApplicationUser settings
|
||||
options.User.RequireUniqueEmail = true;
|
||||
options.User.AllowedUserNameCharacters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@.-_";
|
||||
|
||||
Reference in New Issue
Block a user