Clean guidelines

This commit is contained in:
Aurélien Georget 2015-11-05 15:42:32 +01:00
parent f233466e01
commit 92a4cea98c

View File

@ -245,7 +245,7 @@ module.exports = function (strapi) {
socket.on('err', function (data) {
strapi.log.warn(data.text);
});
});
});
cb();
} else {
@ -268,26 +268,23 @@ module.exports = function (strapi) {
config = JSON.parse(config);
strapi.token = config.token;
socket.emit('getPublicKey', null, function (publicKey) {
if (publicKey) {
if (publicKey && strapi.config.environment === 'development') {
const key = new RSA();
let object;
key.importKey(publicKey, 'public');
if (strapi.config.environment === 'development') {
object = {
appId: strapi.config.studio.appId,
appName: strapi.config.name,
publicKey: strapi.rsa.exportKey('private'),
secretKey: strapi.config.studio.secretKey,
dashboardToken: strapi.config.dashboard.token,
token: strapi.token,
env: strapi.config.environment
};
const object = {
appId: strapi.config.studio.appId,
appName: strapi.config.name,
publicKey: strapi.rsa.exportKey('private'),
secretKey: strapi.config.studio.secretKey,
dashboardToken: strapi.config.dashboard.token,
token: strapi.token,
env: strapi.config.environment
};
socket.emit('check', key.encrypt(object));
}
socket.emit('check', key.encrypt(object));
}
});
}