on ‎2018 May 14 2:25 PM
Hi, In PDP page i have wishlist button , if anonymous user click wishlist button then redirect to login page and after completing login it will be redirect to PDP page rather than "defaultTargetUrl". Same for Save Cart Page Button which is in Cart page . In this two scenario we want back to my previous page and for others my "defaultTargetUrl" will work.
Request clarification before answering.
Hi Sandeep,
The referer concept is provided OOTB. Just use the check whether the user is authorized (i.e. login or not) . Infact this is also OOTB (refer AuthenticationController.java) . If the user successfully login he'll be redirected to the same PDP/ cart page. You can find the implementation at StorefrontAuthenticationSuccessHandler.determineTargetUrl() (Refer the super implementation). Hope this resolves your issue. Let me know if you face something.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
1: Use annotation @RequireHardLogIn on your wishlist controller method.
2: Add a filter where you save the last visited page. sessionService.setAttribute("referal", httpServletRequest.getContextPath());
3: Extend StorefrontAuthenticationSuccessHandler#onAuthenticationSuccess, retrieve the referer from the session service and call getRedirectStrategy().sendRedirect(url);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
can you provide me the answer if you have?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Have please you an answer for this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.