public IActionResult CreateToken([FromBody] UserLogin login) { IActionResult response = Unauthorized(); var user = UserAuthentication.Authenticate(login); if (user != null) { var tokenString = UserAuthentication.BuildToken(user); response = Ok(new { token = tokenString }); } return(response); }