Added logic for user login and registration.