diff --git a/common/models/access-token.js b/common/models/access-token.js index 1ba1e341..43acd2ef 100644 --- a/common/models/access-token.js +++ b/common/models/access-token.js @@ -34,12 +34,6 @@ var DEFAULT_TOKEN_LEN = 64; */ module.exports = function(AccessToken) { - // Workaround for https://github.com/strongloop/loopback/issues/292 - AccessToken.definition.rawProperties.created.default = - AccessToken.definition.properties.created.default = function() { - return new Date(); - }; - /** * Anonymous Token * diff --git a/common/models/access-token.json b/common/models/access-token.json index a5f360c4..85fdf910 100644 --- a/common/models/access-token.json +++ b/common/models/access-token.json @@ -12,7 +12,8 @@ "description": "time to live in seconds (2 weeks by default)" }, "created": { - "type": "Date" + "type": "Date", + "defaultFn": "now" } }, "relations": {