public async Task <ActionResult> Authenticate( [FromBody] LoginRequest model, [FromServices] IAccessManager accessManager) { var token = await accessManager.ForgeTokenAsync(model.Username, model.Password); if (token is null) { return(BadRequest("User or password invalid")); } return(Ok(new { token })); }