Implemented authentication of a user, and registering a new one