Cleaned up userauth, new function localauth