aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/oauth-model.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-05-07 10:39:09 +0200
committerChocobozzz <me@florianbigard.com>2020-05-07 10:39:09 +0200
commit3cc665f48fd233d09f778d7e887488dde6f03ef6 (patch)
treeba8503723206ef17f4b8e4a2e40125472b28dbaf /server/lib/oauth-model.ts
parentee8e602ef9761b4869e14d4d3ed24a2e18f22c65 (diff)
downloadPeerTube-3cc665f48fd233d09f778d7e887488dde6f03ef6.tar.gz
PeerTube-3cc665f48fd233d09f778d7e887488dde6f03ef6.tar.zst
PeerTube-3cc665f48fd233d09f778d7e887488dde6f03ef6.zip
Add last login date to users
Diffstat (limited to 'server/lib/oauth-model.ts')
-rw-r--r--server/lib/oauth-model.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/server/lib/oauth-model.ts b/server/lib/oauth-model.ts
index 136abd0c4..dbcba897a 100644
--- a/server/lib/oauth-model.ts
+++ b/server/lib/oauth-model.ts
@@ -180,6 +180,10 @@ async function saveToken (token: TokenInfo, client: OAuthClientModel, user: User
180 } 180 }
181 181
182 const tokenCreated = await OAuthTokenModel.create(tokenToCreate) 182 const tokenCreated = await OAuthTokenModel.create(tokenToCreate)
183
184 user.lastLoginDate = new Date()
185 await user.save()
186
183 return Object.assign(tokenCreated, { client, user }) 187 return Object.assign(tokenCreated, { client, user })
184} 188}
185 189