Fix for redirection issues

Fix for login-redirection issues with Facebook and Amazon.