User creationDate recorded

This commit is contained in:
Luis Fernando Molina committed 2018-09-25 16:25:36 +02:00
1 parent d1d7fa72b6
commit 48b930e04b
2 files changed
+13

No files matched your search

+1
View File
@@ -6,6 +6,7 @@ const Schema = mongoose.Schema
const userSchema = new Schema({
authId: String,
creationDate: String,
alias: String,
firstName: String,
middleName: String,
+12
View File
@@ -367,9 +367,21 @@ function authenticate (encodedToken, callBackFunction) {
return
}
let localDate = new Date()
let creationDate = new Date(Date.UTC(
localDate.getUTCFullYear(),
localDate.getUTCMonth(),
localDate.getUTCDate(),
localDate.getUTCHours(),
localDate.getUTCMinutes(),
localDate.getUTCSeconds(),
localDate.getUTCMilliseconds())
)
let newUser = new User({
alias: alias,
authId: authId,
creationDate: creationDate.toISOString(),
email: email,
emailVerified: emailVerified,
roleId: '1'