Set the domain only during dns setup

If we change the domain when dns settings are changed, then migration
fails because we callout to appstore API via the domain (for example,
backup url call will fail because it uses the new domain name).
This commit is contained in:
Girish Ramakrishnan
2017-01-10 15:55:31 -08:00
parent ba02d333d1
commit 80d65acd0d
2 changed files with 4 additions and 7 deletions

View File

@@ -88,6 +88,9 @@ function dnsSetup(req, res, next) {
if (typeof req.body.provider !== 'string') return next(new HttpError(400, 'provider is required'));
if (config.fqdn()) return next(new HttpError(409, 'Already setup'));
if (typeof req.body.domain !== 'string' || !req.body.domain) return next(new HttpError(400, 'domain is required'));
config.set('fqdn', req.body.domain);
settings.setDnsConfig(req.body, function (error) {
if (error && error.reason === SettingsError.BAD_FIELD) return next(new HttpError(400, error.message));