the hooks.py you need is the one in your own custom app that you are building. Never think of changing erpnext or frappe files.
In your custom_app
- create a method in some controller to do a redirect
frappe/google_calendar.py at b65a819c6da825bc2fc19ca3d8ce8285c85b99d3 · frappe/frappe · GitHub - set boot_session in your custom_app/hooks.py to point to the method above