don't encode a URL for loginAndRedirect as encode_base64 uses forward
slashes!!! Dammit!. Instead use $window.history.back();