I have an url:
var url = /company/overview
I have query params
var params = {
campaign = "back-to-work"
user = "1"
}
How can I convert these two values (originally extracted from $location.path()
and $location.search()
) into one query parameter called return_to
. I will later attach this return_to
query parameter to a login url.
Github do something similar when trying to access content that requires login:
https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Forgs%2FCompany%2Fdashboard%3Fcampaign%3Dback-to-work