Dynamically change the URL for an internal page

Is there a way to dynamically change a URL to an internal app page?

After the OAuth process, Shopify wants you to redirect users to a manual construction the embedded app URL using the following format: https://{base64_decode(host)}/apps/{api_key}/.

Where you base64 encode a parameter you got from the URL (host). This allows you to get the session token for the user so that they stay “logged in” and you dont need to re-authorize them everytime they flick from one shopify tab to your app and back.

I am not using OAuth 2.0 User-Agent Flow or Custom Token because the URL needs to be dynamic and am instead using lots of client side workflows (am also in the process of rebuilding these as back-end workflows to be more secure/performant).

I see you can send users to a Dynamic page and construct the URL in the Go to Page action, but how does it know that its in fact your app’s main dashboard page?

Apologies in advance if this is a “no duh” question…

Ok wait i think i found the solution, in your shopify partner dashboard in your app you can specify a redirect URL… it must be that when you send the user to https://{base64_decode(host)}/apps/{api_key}/
it redirects to the URL of your app?