Fixing login redirects

Addresses #1017