Samples fix for missing return url

Fixes: https://github.com/aspnet/Identity/issues/262
This commit is contained in:
Hao Kung 2014-11-24 16:29:02 -08:00
parent d4733f9238
commit d2c12e85b8
2 changed files with 2 additions and 2 deletions

View File

@ -40,6 +40,7 @@ namespace IdentitySample.Models
[ValidateAntiForgeryToken] [ValidateAntiForgeryToken]
public async Task<IActionResult> Login(LoginViewModel model, string returnUrl = null) public async Task<IActionResult> Login(LoginViewModel model, string returnUrl = null)
{ {
ViewBag.ReturnUrl = returnUrl;
if (ModelState.IsValid) if (ModelState.IsValid)
{ {
var signInStatus = await SignInManager.PasswordSignInAsync(model.UserName, model.Password, model.RememberMe, shouldLockout: false); var signInStatus = await SignInManager.PasswordSignInAsync(model.UserName, model.Password, model.RememberMe, shouldLockout: false);
@ -55,7 +56,6 @@ namespace IdentitySample.Models
case SignInStatus.Failure: case SignInStatus.Failure:
default: default:
ModelState.AddModelError("", "Invalid username or password."); ModelState.AddModelError("", "Invalid username or password.");
return View(model);
} }
} }

View File

@ -3,7 +3,7 @@
"DefaultAdminPassword": "YouShouldChangeThisPassword1!", "DefaultAdminPassword": "YouShouldChangeThisPassword1!",
"Data": { "Data": {
"IdentityConnection": { "IdentityConnection": {
"Connectionstring": "Server=(localdb)\\mssqllocaldb;Database=IdentityMvc-8-12-14;Trusted_Connection=True;MultipleActiveResultSets=true" "Connectionstring": "Server=(localdb)\\mssqllocaldb;Database=IdentityMvc-11-24-14;Trusted_Connection=True;MultipleActiveResultSets=true"
} }
}, },
"Identity": { "Identity": {