public async Task <IActionResult> Login([FromBody] LoginDto model) { var user = await _accountAppService.Find(model.UserName, model.PasswordHash); if (user != null) { dynamic token = await _accountAppService.CreateToken(user); return(Ok(token)); } return(Unauthorized()); }