activation: move registration into provision model code
This commit is contained in:
@@ -7,7 +7,8 @@ exports = module.exports = {
|
||||
getStatus,
|
||||
};
|
||||
|
||||
const assert = require('assert'),
|
||||
const appstore = require('./appstore.js'),
|
||||
assert = require('assert'),
|
||||
backups = require('./backups.js'),
|
||||
backuptask = require('./backuptask.js'),
|
||||
BoxError = require('./boxerror.js'),
|
||||
@@ -147,6 +148,9 @@ async function activate(username, password, email, displayName, ip, auditSource)
|
||||
|
||||
debug(`activate: user: ${username} email:${email}`);
|
||||
|
||||
const dashboardLocation = await dashboard.getLocation();
|
||||
await appstore.registerCloudron3(dashboardLocation.domain, constants.VERSION);
|
||||
|
||||
const [error, ownerId] = await safe(users.createOwner(email, username, password, displayName, auditSource));
|
||||
if (error && error.reason === BoxError.ALREADY_EXISTS) throw new BoxError(BoxError.CONFLICT, 'Already activated');
|
||||
if (error) throw error;
|
||||
|
||||
Reference in New Issue
Block a user