Skip to content

Commit

Permalink
fix(PWA): post login redirection fails due to default_route conflic…
Browse files Browse the repository at this point in the history
…t with other app (backport #2351) (#2353)

Co-authored-by: Rucha Mahabal <[email protected]>
  • Loading branch information
mergify[bot] and ruchamahabal authored Oct 29, 2024
1 parent 360517e commit a07bca5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion frontend/src/data/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function handleLogin(response) {
employeeResource.reload()

session.user = sessionUser()
router.replace(response.default_route || "/")
router.replace({ path: "/" })
}
}

Expand Down
5 changes: 5 additions & 0 deletions hrms/www/hrms.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,15 @@ def get_boot():
{
"site_name": frappe.local.site,
"push_relay_server_url": frappe.conf.get("push_relay_server_url") or "",
"default_route": get_default_route(),
}
)

bootinfo.lang = frappe.local.lang
load_translations(bootinfo)

return bootinfo


def get_default_route():
return "/hrms"

0 comments on commit a07bca5

Please sign in to comment.