Spring authorization server Redirect to the previous url after successful Authentication
I have a spring Boot application which is protected by spring authorization server. In addition, the frontend of my application is Angular.
I want when a user who is not authenticated and wants to access a resource, he will be directed to the login page first, and after successful authentication, he will be returned to the same resource he requested.
Now the first part of the work works correctly, that is, the user is directed to the login page, but after successful authentication, when I want to return the user to the address page that he requested before authentication, my program does not work. That is, in my code
var savedReq = new HttpSessionRequestCache().getRequest(req, res);
The savedReq variable is always null.