It is almost working right, I will get to that at the end.
First, thank you very much for pointing me in the right direction!!
If it is not to much asked, why does the hook have to be ajax? And yes indeed, why is the "e" replaced with an "r"? I gues both things are connected?
Now, about this almost working right.
I have applied the changes you wrote above and it is working correctly, no more redirects after login. However, the output from the tpl is now done twice, it is looping 2x so to say. That means I see the same menu 2 times underneath eachother.
Could this have to be cause it is now ajax? Should I put it in an ajx block and add the ajax class to the url?
As described here: http://www.cotonti.com/docs/devel/ajax_helpers
<img src="http://www.armaholic.com/datas/thumbs/green-sea-battalion-uniforms-version-03-preview_4.jpg" alt="green-sea-battalion-uniforms-version-03-" />