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
+2 -2
View File
@@ -5,7 +5,7 @@ exports = module.exports = {
getApp: getApp,
getAppVersion: getAppVersion,
registerCloudron: registerCloudron,
registerWithLoginCredentials: registerWithLoginCredentials,
purchaseApp: purchaseApp,
unpurchaseApp: unpurchaseApp,
@@ -386,7 +386,7 @@ function subscribeCloudron(token, callback) {
});
}
function registerCloudron(options, callback) {
function registerWithLoginCredentials(options, callback) {
assert.strictEqual(typeof options, 'object');
assert.strictEqual(typeof callback, 'function');
+1 -1
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));