rename registerCloudron func

This commit is contained in:
Girish Ramakrishnan
2019-05-07 14:16:51 -07:00
parent 3cc320b1d0
commit 3d11dfaae3
2 changed files with 3 additions and 3 deletions

View File

@@ -63,7 +63,7 @@ function registerCloudron(req, res, next) {
if ('totpToken' in req.body && typeof req.body.totpToken !== 'string') return next(new HttpError(400, 'totpToken must be string'));
if (typeof req.body.signup !== 'boolean') return next(new HttpError(400, 'signup must be a boolean'));
appstore.registerCloudron(req.body, function (error) {
appstore.registerWithLoginCredentials(req.body, function (error) {
if (error && error.reason === AppstoreError.ALREADY_EXISTS) return next(new HttpError(409, error.message));
if (error && error.reason === AppstoreError.ACCESS_DENIED) return next(new HttpError(412, error.message));
if (error && error.reason === AppstoreError.ALREADY_REGISTERED) return next(new HttpError(422, error.message));