diff options
Diffstat (limited to 'server/models/oauth-token.js')
-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 23c698732..f6a814c36 100644 --- a/server/models/oauth-token.js +++ b/server/models/oauth-token.js | |||
@@ -28,7 +28,7 @@ mongoose.model('OAuthToken', OAuthTokenSchema) | |||
28 | // --------------------------------------------------------------------------- | 28 | // --------------------------------------------------------------------------- |
29 | 29 | ||
30 | function getByRefreshTokenAndPopulateClient (refreshToken) { | 30 | function getByRefreshTokenAndPopulateClient (refreshToken) { |
31 | return this.findOne({ refreshToken: refreshToken }).populate('client').then(function (token) { | 31 | return this.findOne({ refreshToken: refreshToken }).populate('client').exec().then(function (token) { |
32 | if (!token) return token | 32 | if (!token) return token |
33 | 33 | ||
34 | const tokenInfos = { | 34 | const tokenInfos = { |
@@ -47,9 +47,9 @@ function getByRefreshTokenAndPopulateClient (refreshToken) { | |||
47 | } | 47 | } |
48 | 48 | ||
49 | function getByTokenAndPopulateUser (bearerToken) { | 49 | function getByTokenAndPopulateUser (bearerToken) { |
50 | return this.findOne({ accessToken: bearerToken }).populate('user') | 50 | return this.findOne({ accessToken: bearerToken }).populate('user').exec() |
51 | } | 51 | } |
52 | 52 | ||
53 | function getByRefreshToken (refreshToken) { | 53 | function getByRefreshToken (refreshToken) { |
54 | return this.findOne({ refreshToken: refreshToken }) | 54 | return this.findOne({ refreshToken: refreshToken }).exec() |
55 | } | 55 | } |