public ActionResult Login([FromForm] string email, [FromForm] string password, [FromForm] string remember) { var user = new AccessDto { Email = email, Password = password, RememberMe = remember == "on" ? true : false, }; if (authService.Login(user)) { return(new RedirectResult("/")); } else { throw new NotImplementedException(); var html = System.IO.File.ReadAllText("Web/chat.html"); return(new ContentResult { StatusCode = 401, ContentType = "text/html", Content = html, }); } }
public ActionResult <string> Login([FromBody] AccessDto user) { if (authService.Login(user)) { return(new OkResult()); } else { return(new UnauthorizedResult()); } }