aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/oauth-model.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/oauth-model.ts')
-rw-r--r--server/lib/oauth-model.ts2
1 files changed, 2 insertions, 0 deletions
diff --git a/server/lib/oauth-model.ts b/server/lib/oauth-model.ts
index eb0e63bc8..45ac3e7c4 100644
--- a/server/lib/oauth-model.ts
+++ b/server/lib/oauth-model.ts
@@ -39,6 +39,8 @@ function clearCacheByToken (token: string) {
39function getAccessToken (bearerToken: string) { 39function getAccessToken (bearerToken: string) {
40 logger.debug('Getting access token (bearerToken: ' + bearerToken + ').') 40 logger.debug('Getting access token (bearerToken: ' + bearerToken + ').')
41 41
42 if (!bearerToken) return Bluebird.resolve(undefined)
43
42 if (accessTokenCache[bearerToken] !== undefined) return Bluebird.resolve(accessTokenCache[bearerToken]) 44 if (accessTokenCache[bearerToken] !== undefined) return Bluebird.resolve(accessTokenCache[bearerToken])
43 45
44 return OAuthTokenModel.getByTokenAndPopulateUser(bearerToken) 46 return OAuthTokenModel.getByTokenAndPopulateUser(bearerToken)