diff --git a/src/chapters/auth/configuration.rst b/src/chapters/auth/configuration.rst index 5d6fc19e..8b1f4b3a 100644 --- a/src/chapters/auth/configuration.rst +++ b/src/chapters/auth/configuration.rst @@ -32,7 +32,7 @@ Earlier you may have added the following: options.Password.RequireNonAlphanumeric = false; options.Password.RequireUppercase = true; options.Password.RequireLowercase = false; - }).AddEntityFrameworkStores(); + }).AddEntityFrameworkStores(); This code is dictating the settings for account creation. Right now, for a user to create an account, they have to have the following: @@ -47,7 +47,7 @@ The following is not true for a user to create an account. #. Their password does not have to include lowercase letters. These are just some basic requirements that can be changed to suit the needs of your application. -For a full list of the default settings for users' passwords and how we can change those settings, check out the `documentation `__. +For a full list of the default settings for users' passwords and how we can change those settings, check out the `documentation `__. In ``ConfigureServices()``, we can also configure cookie settings, password hashers, user validation requirements, sign in settings and more. @@ -68,4 +68,4 @@ Here are some examples of what you can do with it. If you want to customize user data, it is best to do so when initially scaffolding the app. `IdentityUser `__ has a number of properties that are important and relevant to storing user data. However, when you read through the requirements you may notice that you need additional properties, such as the user's first and last name. - If you want to add custom properties, check out this `article `__ from Microsoft. \ No newline at end of file + If you want to add custom properties, check out this `article `__ from Microsoft. \ No newline at end of file diff --git a/src/chapters/auth/scaffolding.rst b/src/chapters/auth/scaffolding.rst index 58ed8a3b..d5453b39 100644 --- a/src/chapters/auth/scaffolding.rst +++ b/src/chapters/auth/scaffolding.rst @@ -57,7 +57,7 @@ If the .NET Core SDK listed on line 2 does not match the SDK specified in your ` .. admonition:: Note - If you are do not have a ``global.json`` file, but the .NET Core SDK is still not matching your ``csproj`` file, you can create a new ``global.json`` file with the following command: + If you do not have a ``global.json`` file, but the .NET Core SDK is still not matching your ``csproj`` file, you can create a new ``global.json`` file with the following command: :: @@ -181,7 +181,7 @@ In order to use Identity, we need to change what ``EventDbContext`` extends. Cur .. sourcecode:: csharp - public class JobDbContext: IdentityDbContext + public class EventDbContext: IdentityDbContext We also need to add an additional line to ``OnModelCreating()``: @@ -238,7 +238,7 @@ Add a line to ``ConfigureServices()`` in ``Startup.cs`` for the use of the Razor var serverVersion = new MySqlServerVersion(new Version(8, 0, 29)); var defaultConnection = Configuration.GetConnectionString("DefaultConnection"); - services.AddDbContext(options => + services.AddDbContext(options => options.UseMySql(defaultConnection, serverVersion)); services.AddDefaultIdentity @@ -250,7 +250,7 @@ Add a line to ``ConfigureServices()`` in ``Startup.cs`` for the use of the Razor options.Password.RequireNonAlphanumeric = false; options.Password.RequireUppercase = true; options.Password.RequireLowercase = false; - }).AddEntityFrameworkStores(); + }).AddEntityFrameworkStores(); Review ``Configure()`` in ``Startup.cs``. Above ``app.UseAuthorization()``, add one line of code like so: @@ -259,7 +259,7 @@ Review ``Configure()`` in ``Startup.cs``. Above ``app.UseAuthorization()``, add app.UseAuthentication(); app.UseAuthorization(); -Add an additional line to ``app.UseEndpoints()`` inside of ``Configure()`` in ``Startup.cs``: +Add 2 additional lines to ``app.UseEndpoints()`` inside of ``Configure()`` in ``Startup.cs``: .. sourcecode:: csharp :lineno-start: 62