I’m trying to override the home page for all roles, and after login redirect the users to /app/doctype/view/list instead of the app/desk. Any idea to trigger that redirect after the login?
The only way that has worked for me is to add a redirect-to
query param to the login url: e.g. http://localhost:8000/?redirect-to=/app/crate#login
You could do with some custom JS or a custom login page.
Incidentally, I have tried various ways to do this without much success:
- Using the Auth Hooks to add the URL to
frappe.flags
andfrappe.local.flags
(neither works, as they are overwritten by the cache) or setting the cache directly (set but ignored in any case).
def on_login(login_manager):
frappe.cache().hset("redirect_after_login", login_manager.user, "/app/crate")
-
Global redirects work (
/app
→/app/<xyz>
) but weren’t what I was after.
$('.btn-login').click(function(){
setTimeout(function(){
location.href = "/app/lead"
}, 300);
})
This code put in website script to redirect lead list
1 Like