void IProvideAllOfTheRequiredDataForTheLoginPage() { _command = new PostAuthenticateUserCommand { Username = _registerCommand.Email, Password = _registerCommand.Password }; }
public void Authenticate(string username, string password = "******") { var authUserCommand = new PostAuthenticateUserCommand { Username = username, Password = password }; var result = CallClientPost <PostAuthenticateUserCommandResult>("api/users/authenticate", authUserCommand); _jwt = result.Token; }
public async Task <IActionResult> Authenticate([FromBody] PostAuthenticateUserCommand command) { var result = await _mediator.Send(command); if (result == null) { return(BadRequest(new { message = "Username or password is incorrect." })); } return(Ok(result)); }