Add unit tests and method to register user given authentication hash