Small cleanup on Account service.
This commit is contained in:
parent
13ed323949
commit
67b97b3be2
1 changed files with 1 additions and 1 deletions
|
|
@ -60,7 +60,7 @@ namespace API.Controllers
|
||||||
[HttpPost("login")]
|
[HttpPost("login")]
|
||||||
public async Task<ActionResult<UserDto>> Login(LoginDto loginDto)
|
public async Task<ActionResult<UserDto>> Login(LoginDto loginDto)
|
||||||
{
|
{
|
||||||
var user = await _context.Users.SingleOrDefaultAsync(x => x.UserName == loginDto.Username.ToLower());
|
var user = await _userRepository.GetUserByUsernameAsync(loginDto.Username);
|
||||||
|
|
||||||
if (user == null) return Unauthorized("Invalid username");
|
if (user == null) return Unauthorized("Invalid username");
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue