caas: remove setupDone
This commit is contained in:
@@ -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));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user