I am using Spring Security and wondering how can I implement redirection after succesfull login to the source page if that page contains #
(hash) sign.
Right now I use always-use-default-target="false"
and it works fine on URL kind of: /path/to/page/
.
But when the URL become to #/path/to/page
it doesn't make any redirections.
Is there any way to fix it?
Here is the solution I used at the end:
$(document).ready(function(){
$('#auth-form').submit(function() {
var el = $(this);
var hash = window.location.hash;
if (hash) el.prop('action', el.prop('action') + '#' + unescape(hash.substring(1)));
return true;
});
});
This snippet addes the hash to authorization form's action attribute and Spring redirect you to the URL of kind: #/path/to/page
without any problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With