Created
August 31, 2020 14:02
-
-
Save CoskunKurtuldu/b357bc1f87101b1e3ed51aee2510a9fd 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
[HttpPost("SignIn")] | |
public async Task<IActionResult> SignIn(UserLoginDTO userLoginDto) | |
{ | |
var user = _userManager.Users.SingleOrDefault(u => u.UserName == userLoginDto.Email); | |
if (user is null) | |
{ | |
return NotFound("User not found"); | |
} | |
var userSigninResult = await _userManager.CheckPasswordAsync(user, userLoginDto.Password); | |
if (userSigninResult) | |
{ | |
return Ok(); | |
} | |
return BadRequest("Email or password incorrect."); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment