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 (#2351)

(cherry picked from commit 4ba8046)
  • Loading branch information
ruchamahabal authored and mergify[bot] committed Oct 29, 2024
1 parent 360517e commit e35129b
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 e35129b

Please sign in to comment.