Let's explore how we can pass query params to the URL before redirecting to the login page so that we can transport some state from the main app to the login page.
It's up to you to implement it however you want but here's a solution off the shelf for you to use