This code is repeated now in several places, refactor it and create a function for reusing the code
var domain = this.driver.config.get(corbel.Iam.IAM_DOMAIN, 'unauthenticated');
var customDomain = this.driver.config.get(corbel.Domain.CUSTOM_DOMAIN, domain);
this.driver.config.set(corbel.Domain.CUSTOM_DOMAIN, undefined);
This code is repeated now in several places, refactor it and create a function for reusing the code