// On login to subdomain https://yourcustomer.yourapp.com
localStorage.setItem('subdomain', 'yourcustomer');
// When not already on subdomain then redirect to last used subdomain
const subdomain = localStorage.getItem('subdomain')
window.location = `https://${subdomain}.yourapp.com`