Added authentication for registration.