oauthjs / angular-oauth2

AngularJS OAuth2
MIT License
595 stars 187 forks source link

Unable to open link in new tab or deep link #160

Open steven-rothwell opened 3 years ago

steven-rothwell commented 3 years ago

So, if I have the main page of my site www.my-site.com as the main page, I can click a link that routes me to www.my-site.com/items/some-id. This works fine. I can even paste www.my-site.com/items/some-id into the same tab and it correctly take me there. But, if I try to open that link in a new tab or copy and paste (www.my-site.com/items/some-id) into a new tab, it redirects me back to www.my-site.com. I was able to see that this is happening because in the new tab, the very first thing is does is hits my identity server which returns a 302 back to www.my-site.com. That is because in my auth config which inherits from oauth2's AuthConfig, I have the redirectUri set to www.my-site.com. How can I set the redirectUri to be whatever the current uri is? That way, if I am logged in and try to open in a new tab or even if I'm logged out and try to go to a deep link, after logging in, it takes me to that page?