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();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue