Vizzuality/cartodb — pull request #579 by ferblape (2012-03-09 11:47:56+00:00)
Title: Fix oauth redirects

There was a bug in OAuth authentication, caused by the different hosts in which the application runs:

- if a user2 was trying to get tokens using an OAuth application with the credentials of user1, after the login in `user1.cartodb.com`, the user was redirected to his own subdomain, where the tokens didn't exist and the authorization was never done.

To fix this, in the `return_to` variable, the host is kept also, to do a proper redirection.

I have also fixed a problem in development mode, where the urls when redirected had the form: `blat.localhost.lan3000` (colon symbol was missing).

If you accept it, [Batman will be happy](http://assets0.ordienetworks.com/images/GifGuide/dancing/300sw047yusw9.gif)