diff --git a/src/routes/cloudron.js b/src/routes/cloudron.js index ff6d6fda5..39a7fb1b7 100644 --- a/src/routes/cloudron.js +++ b/src/routes/cloudron.js @@ -57,8 +57,11 @@ function activate(req, res, next) { if (error && error.reason === CloudronError.BAD_EMAIL) return next(new HttpError(400, 'Bad email')); if (error) return next(new HttpError(500, error)); + // only in caas case do we have to notify the api server about activation + if (config.provider() !== 'caas') return next(new HttpSuccess(201, info)); + // Now let the api server know we got activated - superagent.post(config.apiServerOrigin() + '/api/v1/boxes/' + config.fqdn() + '/setup/done').query({ setupToken:req.query.setupToken }).end(function (error, result) { + superagent.post(config.apiServerOrigin() + '/api/v1/boxes/' + config.fqdn() + '/setup/done').query({ setupToken: req.query.setupToken }).end(function (error, result) { if (error && !error.response) return next(new HttpError(500, error)); if (result.statusCode === 403) return next(new HttpError(403, 'Invalid token')); if (result.statusCode === 409) return next(new HttpError(409, 'Already setup'));