I use Spring Security to deal with session timeout. My application also uses AngularJs.
I have the following issue:
If the session times out and a user issues a non-ajax request from an angularJs page to a secured url, Spring Security redirects me to the login url but keeps the part of the Url after the # (hash) sign.
Let me illustrate:
- A user is located at /myapp/foo#!/bar
- Session times out
- User issues get request to secured url
- User is redirected to /myapp/signin#!/bar
How can I avoid the #!/bar part from being added to signin page?
Edit: There is a slight mistake in the description above. The problematic use case is as follows:
- A user is not logged in and tries and access a protected resource such as:
localhost:8080/bignibou/curriculum/#/view/1(by pasting this url in browser's address bar for instance). - They will automatically be redirected to the following Url:
http://localhost:8080/bignibou/signin#/view/1
Notice the part including and after the hash sign is kept. Note that this has more to do with AngularJs than Spring Security as Spring Security does not include the hash sign (this is confirmed by the fact that the hash never appears in the network tab of chrome dev tools...)