rackerlabs/encore-ui — pull request #402 by hussamd (2014-07-21 16:18:30+00:00)
Title: fix(interceptor): URL encode to maintain params

This adds the ability to maintain query params from the page one was redirected out of.

`$window.location.pathname` properly takes `` into consideration so we no longer need `$location.absUrl()`. Also, it already includes the `$location.search()` bit as a string so we can pass it through to `$window.location =` for a redirect.

All we have to do is properly `encodeURIComponent()` so that the browser doesn't see the `/login?redirect=` and remove any other params with a `?` in them (thanks @halkon).

`$window.location.pathname` is being used in ticketing; stole idea from there. Ticketing is dependent on this change as well (users that get logged out, are brought back to the ticket queue page with no query params, which kicks off logic to remove their user settings and they have to re-select all their ticket queues to monitor).