Try ERPNext Buy Support Partners Foundation Foundation Members

How to redirect to item in webshop after successful oAuth login

When a user selects an item and is not logged in, then s*he is requested to login to order it. The users expect to be redirected to last item visited and not start over again to search for the item.

We let users sign up with oAuth / fairlogin, so the relevant code is in : apps/frappe/frappe/utils/oauth.py

def redirect_post_login(desk_user):
        # redirect!
        frappe.local.response["type"] = "redirect"

        # the #desktop is added to prevent a facebook redirect bug
#       frappe.local.response["location"] = "/desk#desktop" if desk_user else "/me"
# after login go to start page, not to settings RAS 2019-09-28
        frappe.local.response["location"] = "/desk#desktop" if desk_user else "/"

I can change the location after the else, however I also do not want the user show the start page. Is there any such command like frappe.local.response["location"] = history -1 so that users see again the page before they had logged in?