Switched to using angular locationProvider, which resolved login
redirect to referrer issue