Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 09a9bd3

Browse files
Email confirmation for login
1 parent 763f094 commit 09a9bd3

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

‎Webgentle.BookStore/Webgentle.BookStore/Controllers/AccountController.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,15 @@ public async Task<IActionResult> Login(SignInModel signInModel, string returnUrl
7070
}
7171
return RedirectToAction("Index", "Home");
7272
}
73-
74-
ModelState.AddModelError("", "Invalid credentials");
73+
if (result.IsNotAllowed)
74+
{
75+
ModelState.AddModelError("", "Not allowed to login");
76+
}
77+
else
78+
{
79+
ModelState.AddModelError("", "Invalid credentials");
80+
}
81+
7582
}
7683

7784
return View(signInModel);

‎Webgentle.BookStore/Webgentle.BookStore/Startup.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ public void ConfigureServices(IServiceCollection services)
4747
options.Password.RequireLowercase = false;
4848
options.Password.RequireNonAlphanumeric = false;
4949
options.Password.RequireUppercase = false;
50+
51+
options.SignIn.RequireConfirmedEmail = true;
5052
});
5153

5254
services.ConfigureApplicationCookie(config =>

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /