Fix broken login

Hi Jonathan!

As discussed on oDesk - here is the code. You can check it locally, deploy to your heroku instance.
It is completely free for you. Just use the solution.

--
Petro