Copied validation for user creation into command handler.