2fa security key breaks when migrating to custom domain

I will close this old bug topic. If there is anything remaining to do we can reopen it or start a new one.