It would be really nice if the user->getReturnUrl() method took into account whether “showScriptName” was true/false in the ©UrlManager.
When showScriptName is false, user->getReturnUrl still returns the scriptUrl as a default, which is no good if you don't want "index.php" (or whatever) visible to your users.
Hope that made sense! Maybe I'm missing a small config change which would fix this?
Tnx