diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-11-01 18:16:47 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-11-01 18:16:47 +0100 |
commit | bf2fc85c834f5be016f119f59844e49fe3751e6a (patch) | |
tree | 6e717c10a6037a9829d2ad8e82f4e3cf28b2a3f8 /server/models | |
parent | 2c8a2f7fcc032f36a253af18b47069e80df964c6 (diff) | |
download | PeerTube-bf2fc85c834f5be016f119f59844e49fe3751e6a.tar.gz PeerTube-bf2fc85c834f5be016f119f59844e49fe3751e6a.tar.zst PeerTube-bf2fc85c834f5be016f119f59844e49fe3751e6a.zip |
Server: fix refreshing token that fails
Diffstat (limited to 'server/models')
-rw-r--r-- | server/models/oauth-token.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/server/models/oauth-token.js b/server/models/oauth-token.js index 5beb47bed..04fb9540d 100644 --- a/server/models/oauth-token.js +++ b/server/models/oauth-token.js | |||
@@ -20,7 +20,7 @@ OAuthTokenSchema.path('user').required(true) | |||
20 | OAuthTokenSchema.statics = { | 20 | OAuthTokenSchema.statics = { |
21 | getByRefreshTokenAndPopulateClient, | 21 | getByRefreshTokenAndPopulateClient, |
22 | getByTokenAndPopulateUser, | 22 | getByTokenAndPopulateUser, |
23 | getByRefreshToken, | 23 | getByRefreshTokenAndPopulateUser, |
24 | removeByUserId | 24 | removeByUserId |
25 | } | 25 | } |
26 | 26 | ||
@@ -51,8 +51,8 @@ function getByTokenAndPopulateUser (bearerToken) { | |||
51 | return this.findOne({ accessToken: bearerToken }).populate('user').exec() | 51 | return this.findOne({ accessToken: bearerToken }).populate('user').exec() |
52 | } | 52 | } |
53 | 53 | ||
54 | function getByRefreshToken (refreshToken) { | 54 | function getByRefreshTokenAndPopulateUser (refreshToken) { |
55 | return this.findOne({ refreshToken: refreshToken }).exec() | 55 | return this.findOne({ refreshToken: refreshToken }).populate('user').exec() |
56 | } | 56 | } |
57 | 57 | ||
58 | function removeByUserId (userId, callback) { | 58 | function removeByUserId (userId, callback) { |