Implementing user login and registration