Added AccessToken created property
This commit is contained in:
parent
1bb95607b9
commit
efce5039f6
|
@ -15,7 +15,8 @@ var Model = require('../loopback').Model
|
||||||
var properties = {
|
var properties = {
|
||||||
id: {type: String, generated: true, id: 1},
|
id: {type: String, generated: true, id: 1},
|
||||||
uid: {type: String},
|
uid: {type: String},
|
||||||
ttl: {type: Number, ttl: true}
|
ttl: {type: Number, ttl: true}, // time to live in seconds
|
||||||
|
created: {type: Date}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -52,6 +53,7 @@ AccessToken.beforeCreate = function (next, data) {
|
||||||
next(err);
|
next(err);
|
||||||
} else {
|
} else {
|
||||||
data.id = id;
|
data.id = id;
|
||||||
|
|
||||||
next();
|
next();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -15,4 +15,4 @@ module.exports = function(dataSource) {
|
||||||
dataSource = dataSource || new require('loopback-datasource-juggler').ModelBuilder();
|
dataSource = dataSource || new require('loopback-datasource-juggler').ModelBuilder();
|
||||||
var Role = dataSource.define('Role', RoleSchema);
|
var Role = dataSource.define('Role', RoleSchema);
|
||||||
return Role;
|
return Role;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue