Created
September 27, 2017 14:41
-
-
Save JudahGabriel/7ff40754ea572829cdd5ca822e6c87b6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AccountController : Controller | |
{ | |
private UserManager<AppUser> userManager; | |
private SignInManager<AppUser> signInManager; | |
// RavenDB.Identity provides a UserManager and SignInManager for dependency injection. | |
public AccountController(UserManager<AppUser> userManager, SignInManager<AppUser> signInManager) | |
{ | |
this.userManager = userManager; | |
this.signInManager = signInManager; | |
} | |
public async Task<IActionResult> LogIn(LoginViewModel model) | |
{ | |
// Use the standard Identity APIs, like .PasswordSignInAsync | |
await this.signInManager.PasswordSignInAsync( | |
model.Email, | |
model.Password, | |
model.RememberMe, | |
lockoutOnFailure: false); | |
... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment