Custom Domains - Share Data between - Share Session

In my application, the user has a team, and this team can have a custom domain.

I created a middleware that validates if the user has a custom domain. If they do and are accessing the application with a default domain, I would like to redirect them to the custom domain. However, when I do this, I lose the session, and the user is taken back to the login screen.

If I hadn't lost the session, the problem would have been resolved, but as I wasn't able to do this, I chose to continue and display a message on the login screen, advising that the user has a custom domain and therefore must log in again, but when redirect also I can no longer display the message on the login page, I even tried to overwrite the login View and pass some information via URL but it is not possible.

The closest i got:
Was this page helpful?