Allow app.id to be set

This commit is contained in:
Raymond Feng 2013-11-22 09:09:02 -08:00
parent a72a42e436
commit 23cf373432
1 changed files with 1 additions and 1 deletions

View File

@ -100,7 +100,7 @@ var Application = loopback.createModel('Application', ApplicationSchema);
Application.beforeCreate = function (next) {
var app = this;
app.created = app.modified = new Date();
app.id = generateKey('id', 'sha1');
app.id = app.id || generateKey('id', 'sha1');
app.clientKey = generateKey('client');
app.javaScriptKey = generateKey('javaScript');
app.restApiKey = generateKey('restApi');