caas: remove setupDone

This commit is contained in:
Girish Ramakrishnan
2019-05-08 15:27:29 -07:00
parent b0fb989be0
commit 25604774b9
2 changed files with 1 additions and 34 deletions

View File

@@ -111,18 +111,7 @@ function activate(req, res, next) {
if (error && error.reason === ProvisionError.BAD_FIELD) return next(new HttpError(400, error.message));
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));
caas.setupDone(req.query.setupToken, function (error) {
if (error && error.reason === CaasError.BAD_STATE) return next(new HttpError(409, 'Already setup'));
if (error && error.reason === CaasError.INVALID_TOKEN) return next(new HttpError(401, 'Invalid token'));
if (error && error.reason === CaasError.EXTERNAL_ERROR) return next(new HttpError(424, error.message));
if (error) return next(new HttpError(500, error));
next(new HttpSuccess(201, info));
});
next(new HttpSuccess(201, info));
});
}