src/liteAuth.php
public function registerFromPost()
    {
        if($_SERVER['REQUEST_METHOD'] == 'POST')
        {
            if(!isset($_POST['user']) OR $_POST['user'] == '')
            {
                throw new \Exception('Must set a username.');
            }
            if(!isset($_POST['pass']) OR $_POST['pass'] == '')
            {
                throw new \Exception('Must set a password.');
            }
            if($_POST['pass']!=$_POST['pass2'])
            {
                throw new \Exception('passwords don\'t match.');
            }
            $email = isset($_POST['email']) ? $_POST['email'] : null;
            $fname = isset($_POST['fname']) ? $_POST['fname'] : null;
            $sname = isset($_POST['sname']) ? $_POST['sname'] : null;
            $admin = isset($_POST['admin']) ? 1 : 0;
            return $this->newUser($_POST['user'], $_POST['pass'], $email, $fname, $sname , $admin);
        }
    }
public function registerFromPost()
    {
        if($_SERVER['REQUEST_METHOD'] == 'POST')
        {
            if(!isset($_POST['user']) OR $_POST['user'] == '')
            {
                throw new \Exception('Must set a username.');
            }
            if(!isset($_POST['pass']) OR $_POST['pass'] == '')
            {
                throw new \Exception('Must set a password.');
            }
            if($_POST['pass']!=$_POST['pass2'])
            {
                throw new \Exception('passwords don\'t match.');
            }
            $email = isset($_POST['email']) ? $_POST['email'] : null;
            $fname = isset($_POST['fname']) ? $_POST['fname'] : null;
            $sname = isset($_POST['sname']) ? $_POST['sname'] : null;
            $admin = isset($_POST['admin']) ? 1 : 0;
            return $this->newUser($_POST['user'], $_POST['pass'], $email, $fname, $sname , $admin);
        }
    }
Similarly to loginFromPost(), takes POST data and uses it to register a new user
NOTE: it looks for both 'pass1' and 'pass2', and requires both to exist, and match, to be successful