Redirect after user creation via form What would be the proper hook to redirect after the user registration form is submitted and is in valid state?

I'm trying to automatically create a certain content-type node when a user registers and I want to redirect the user to that node's edit form after the user creation form is submitted and validated.

I was thinking of doing this in a mymodule_user_form_submit hook, but not sure if a) this hook exists and b) the validation in place for user registration will still work as intended.

Can anyone share some pointers?

EDIT:

Would the mymodule_user_insert hook run after the validation and submission of the form? Can I redirect from there? AFAIK, I won't have a form_state variable to act on, right?

EDIT2:

While researching for a solution, I noticed I have another (probably bigger) problem: the content-type node I need to create must hold a reference to the user's ID, so I'm getting in a chicken-or-egg situation.

I actually need to create said node after the user is created (otherwise I'll have no user_id), but I need to redirect to the node's edit form after user creation, which means I can't redirect with $form_state.

I think I got everything right, but I would love to be wrong. :D

Can anyone help?
If you have created a custom user registration form my_module_user_register_form, then you can define one or more submit functions for it

function my_module_user_register_form($form, &amp;$form_state) {
    $form['#submit'][] = 'my_module_user_register_form_submit';
    // and now add a second submit function if you like
    $form['#submit'][] = 'my_module_user_register_form_another_submit';
}


and then place the appropriate redirect at the end of the last submit function.

function my_module_user_register_form_another_submit($form, &amp;$form_state) {
   // do other stuff here 
   $form_state-&gt;setRedirect('node/123/edit');
}