rename registerCloudron func
This commit is contained in:
+2
-2
@@ -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');
|
||||
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user