Skip to content

Commit 99b2fec

Browse files
committed
Hide forgot pwd when email not configured
1 parent 4c0a970 commit 99b2fec

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

Blogifier.Web/Controllers/AccountController.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ public async Task<IActionResult> Login(string returnUrl = null)
6262

6363
ViewData["ReturnUrl"] = returnUrl;
6464
ViewData["ShowRegistration"] = IsFirstAdminAccount();
65+
ViewData["ShowForgotPwd"] = _emailSender.Enabled;
6566
return View();
6667
}
6768

Blogifier.Web/Views/Account/Login.cshtml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
@{
55
ViewData["Title"] = "Log in";
66
bool showRegistration = ViewData["ShowRegistration"] != null && (bool)ViewData["ShowRegistration"];
7+
bool showForgotPwd = ViewData["ShowForgotPwd"] != null && (bool)ViewData["ShowForgotPwd"];
78
}
89

910
<div class="form-login">
@@ -29,9 +30,12 @@
2930
</label>
3031
</div>
3132
<button type="submit" class="btn btn-lg btn-primary btn-block">Sign in</button>
32-
<div class="mt-3">
33-
<a asp-action="ForgotPassword" class="btn btn-link btn-sm btn-block">Forgot your password?</a>
34-
</div>
33+
@if (showForgotPwd)
34+
{
35+
<div class="mt-3">
36+
<a asp-action="ForgotPassword" class="btn btn-link btn-sm btn-block">Forgot your password?</a>
37+
</div>
38+
}
3539

3640
@if (showRegistration)
3741
{

0 commit comments

Comments
 (0)