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/lib | |
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/lib')
-rw-r--r-- | server/lib/oauth-model.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/server/lib/oauth-model.js b/server/lib/oauth-model.js index 45f796796..922ef0b1f 100644 --- a/server/lib/oauth-model.js +++ b/server/lib/oauth-model.js | |||
@@ -60,7 +60,7 @@ function getUser (username, password) { | |||
60 | } | 60 | } |
61 | 61 | ||
62 | function revokeToken (token) { | 62 | function revokeToken (token) { |
63 | return OAuthToken.getByRefreshToken(token.refreshToken).then(function (tokenDB) { | 63 | return OAuthToken.getByRefreshTokenAndPopulateUser(token.refreshToken).then(function (tokenDB) { |
64 | if (tokenDB) tokenDB.remove() | 64 | if (tokenDB) tokenDB.remove() |
65 | 65 | ||
66 | /* | 66 | /* |
@@ -72,6 +72,7 @@ function revokeToken (token) { | |||
72 | */ | 72 | */ |
73 | const expiredToken = tokenDB | 73 | const expiredToken = tokenDB |
74 | expiredToken.refreshTokenExpiresAt = new Date('2015-05-28T06:59:53.000Z') | 74 | expiredToken.refreshTokenExpiresAt = new Date('2015-05-28T06:59:53.000Z') |
75 | |||
75 | return expiredToken | 76 | return expiredToken |
76 | }) | 77 | }) |
77 | } | 78 | } |