How to keep the original url that the user was navigating to? Say I have an unauthenticated user navigates to http://localhost:9000/customer/123
To authenticate the user I would do a:
// in my app.js
new Oidc.UserManager().signinRedirect({state:'customer/123'}); // need a way to keep this url
When that returns to the callback.html where I need a way of going to the origianal url:
// callback.html
<script src="oidc-client.js"></script>
<script>
Oidc.Log.logger = console;
new Oidc.UserManager().signinRedirectCallback().then(function () {
var state = 'customer/123' // how to do a redirect to the page originally requested page?
window.location.href="http://localhost:9000/ + state
}).catch(function (e) {
console.error(e);
});
</script>
Or maybe there are other build in ways of getting the origianl url?
Thanks for any help!