From f72a29671fa41b0a767aa8454bf5ad45010bafed Mon Sep 17 00:00:00 2001 From: Loay Date: Tue, 22 Nov 2016 20:54:08 -0500 Subject: [PATCH] Remove workaround for default value --- common/models/access-token.js | 6 ------ common/models/access-token.json | 3 ++- 2 files changed, 2 insertions(+), 7 deletions(-) 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": {