public JsonResult GetJWT([FromBody] UserInfo user) { JsonResult categoryJson = null; if (AuthHelper.CheckValidUser(user)) { categoryJson = new JsonResult(Model.JWTokenHelper.GenerateJWT(user)); } else { categoryJson = new JsonResult("Invalid user/password"); } return(categoryJson); }
public async Task <JsonResult> GetJWT([FromBody] UserInfo user) { JsonResult categoryJson = null; if (AuthHelper.CheckValidUser(user)) { var jwt = await Tokens.GenerateJwt(user, _jwtFactory, _jwtOptions, new JsonSerializerSettings { Formatting = Formatting.Indented }); categoryJson = new JsonResult(jwt); } else { categoryJson = new JsonResult("Invalid user/password"); } return(categoryJson); }