Updated per KB 3137909.
This commit is contained in:
parent
378cc97bd0
commit
de7475cc33
|
|
@ -163,6 +163,8 @@ namespace MusicStore.Controllers
|
||||||
|
|
||||||
//
|
//
|
||||||
// GET: /Account/RemovePhoneNumber
|
// GET: /Account/RemovePhoneNumber
|
||||||
|
[HttpPost]
|
||||||
|
[ValidateAntiForgeryToken]
|
||||||
public async Task<IActionResult> RemovePhoneNumber()
|
public async Task<IActionResult> RemovePhoneNumber()
|
||||||
{
|
{
|
||||||
var user = await GetCurrentUserAsync();
|
var user = await GetCurrentUserAsync();
|
||||||
|
|
@ -172,10 +174,10 @@ namespace MusicStore.Controllers
|
||||||
if (result.Succeeded)
|
if (result.Succeeded)
|
||||||
{
|
{
|
||||||
await SignInManager.SignInAsync(user, isPersistent: false);
|
await SignInManager.SignInAsync(user, isPersistent: false);
|
||||||
return RedirectToAction("Index", new { Message = ManageMessageId.RemovePhoneSuccess });
|
return RedirectToAction(nameof(Index), new { Message = ManageMessageId.RemovePhoneSuccess });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return RedirectToAction("Index", new { Message = ManageMessageId.Error });
|
return RedirectToAction(nameof(Index), new { Message = ManageMessageId.Error });
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
||||||
|
|
@ -1,97 +1,70 @@
|
||||||
@model IndexViewModel
|
@model IndexViewModel
|
||||||
@{
|
@{
|
||||||
ViewBag.Title = "Manage your account";
|
ViewData["Title"] = "Manage your account";
|
||||||
}
|
}
|
||||||
|
|
||||||
<h2>@ViewBag.Title.</h2>
|
<h2>@ViewData["Title"].</h2>
|
||||||
|
<p class="text-success">@ViewData["StatusMessage"]</p>
|
||||||
|
|
||||||
<p class="text-success">@ViewBag.StatusMessage</p>
|
|
||||||
<div>
|
<div>
|
||||||
<h4>Change your account settings</h4>
|
<h4>Change your account settings</h4>
|
||||||
<hr />
|
<hr />
|
||||||
<dl class="dl-horizontal">
|
<dl class="dl-horizontal">
|
||||||
<dt>Password:</dt>
|
<dt>Password:</dt>
|
||||||
<dd>
|
<dd>
|
||||||
[
|
|
||||||
@if (Model.HasPassword)
|
@if (Model.HasPassword)
|
||||||
{
|
{
|
||||||
<a asp-controller="Manage" asp-action="ChangePassword">Change</a>
|
<text>[ <a asp-controller="Manage" asp-action="ChangePassword">Change</a> ]</text>
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<a asp-controller="Manage" asp-action="SetPassword">Create</a>
|
<text>[ <a asp-controller="Manage" asp-action="SetPassword">Create</a> ]</text>
|
||||||
}
|
}
|
||||||
]
|
|
||||||
</dd>
|
</dd>
|
||||||
<dt>External Logins:</dt>
|
<dt>External Logins:</dt>
|
||||||
<dd>
|
<dd>
|
||||||
@Model.Logins.Count [<a asp-controller="Manage" asp-action="ManageLogins">Manage</a>]
|
@Model.Logins.Count [ <a asp-controller="Manage" asp-action="ManageLogins">Manage</a> ]
|
||||||
</dd>
|
</dd>
|
||||||
@*
|
|
||||||
Phone Numbers can used as a second factor of verification in a two-factor authentication system.
|
|
||||||
|
|
||||||
See <a href="http://go.microsoft.com/fwlink/?LinkId=313242">this article</a>
|
|
||||||
for details on setting up this ASP.NET application to support two-factor authentication using SMS.
|
|
||||||
|
|
||||||
Uncomment the following block after you have set up two-factor authentication
|
|
||||||
*@
|
|
||||||
|
|
||||||
<dt>Phone Number:</dt>
|
<dt>Phone Number:</dt>
|
||||||
<dd>
|
<dd>
|
||||||
@(Model.PhoneNumber ?? "None") [
|
<p>
|
||||||
@if (Model.PhoneNumber != null)
|
Phone Numbers can used as a second factor of verification in two-factor authentication.
|
||||||
{
|
See <a href="http://go.microsoft.com/fwlink/?LinkID=532713">this article</a>
|
||||||
<a asp-controller="Manage" asp-action="AddPhoneNumber">Change</a>
|
for details on setting up this ASP.NET application to support two-factor authentication using SMS.
|
||||||
@: |
|
</p>
|
||||||
<a asp-controller="Manage" asp-action="RemovePhoneNumber">Remove</a>
|
@*@(Model.PhoneNumber ?? "None")
|
||||||
}
|
@if (Model.PhoneNumber != null)
|
||||||
else
|
{
|
||||||
{
|
<br />
|
||||||
<a asp-controller="Manage" asp-action="AddPhoneNumber">Add</a>
|
<text>[ <a asp-controller="Manage" asp-action="AddPhoneNumber">Change</a> ]</text>
|
||||||
}
|
<form asp-controller="Manage" asp-action="RemovePhoneNumber" method="post" role="form">
|
||||||
]
|
[<button type="submit" class="btn-link">Remove</button>]
|
||||||
|
</form>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<text>[ <a asp-controller="Manage" asp-action="AddPhoneNumber">Add</a> ]</text>
|
||||||
|
}*@
|
||||||
</dd>
|
</dd>
|
||||||
|
|
||||||
<dt>Two-Factor Authentication:</dt>
|
<dt>Two-Factor Authentication:</dt>
|
||||||
<dd>
|
<dd>
|
||||||
@if (Model.TwoFactor)
|
<p>
|
||||||
{
|
There are no two-factor authentication providers configured. See <a href="http://go.microsoft.com/fwlink/?LinkID=532713">this article</a>
|
||||||
<form asp-controller="Manage" asp-action="DisableTwoFactorAuthentication" method="post" class="form-horizontal" role="form">
|
for setting up this application to support two-factor authentication.
|
||||||
<p>
|
</p>
|
||||||
Enabled
|
@*@if (Model.TwoFactor)
|
||||||
<input type="submit" value="Disable" class="btn btn-link" />
|
{
|
||||||
</p>
|
<form asp-controller="Manage" asp-action="DisableTwoFactorAuthentication" method="post" class="form-horizontal" role="form">
|
||||||
</form>
|
Enabled [<button type="submit" class="btn-link">Disable</button>]
|
||||||
}
|
</form>
|
||||||
else
|
}
|
||||||
{
|
else
|
||||||
<form asp-controller="Manage" asp-action="EnableTwoFactorAuthentication" method="post" class="form-horizontal" role="form">
|
{
|
||||||
<p>
|
<form asp-controller="Manage" asp-action="EnableTwoFactorAuthentication" method="post" class="form-horizontal" role="form">
|
||||||
Disabled
|
[<button type="submit" class="btn-link">Enable</button>] Disabled
|
||||||
<input type="submit" value="Enable" class="btn btn-link" />
|
</form>
|
||||||
</p>
|
}*@
|
||||||
</form>
|
|
||||||
}
|
|
||||||
</dd>
|
|
||||||
<dt>Browser remembered:</dt>
|
|
||||||
<dd>
|
|
||||||
@if (Model.BrowserRemembered)
|
|
||||||
{
|
|
||||||
<form asp-controller="Manage" asp-action="ForgetBrowser" method="post" class="form-horizontal" role="form">
|
|
||||||
<p>
|
|
||||||
Browser is curently remembered for two factor:
|
|
||||||
<input type="submit" value="Forget Browser" class="btn btn-default" />
|
|
||||||
</p>
|
|
||||||
</form>
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
<form asp-controller="Manage" asp-action="ForgetBrowser" method="post" class="form-horizontal" role="form">
|
|
||||||
<p>
|
|
||||||
Browser is curently not remembered for two factor:
|
|
||||||
<input type="submit" value="Remember Browser" class="btn btn-default" />
|
|
||||||
</p>
|
|
||||||
</form>
|
|
||||||
}
|
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
Loading…
Reference in New Issue