aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models
diff options
context:
space:
mode:
Diffstat (limited to 'server/models')
-rw-r--r--server/models/users.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/server/models/users.js b/server/models/users.js
index 046fe462d..a852bf25b 100644
--- a/server/models/users.js
+++ b/server/models/users.js
@@ -35,6 +35,7 @@ const Users = {
35 getAccessToken: getAccessToken, 35 getAccessToken: getAccessToken,
36 getClient: getClient, 36 getClient: getClient,
37 getClients: getClients, 37 getClients: getClients,
38 getFirstClient: getFirstClient,
38 getRefreshToken: getRefreshToken, 39 getRefreshToken: getRefreshToken,
39 getUser: getUser, 40 getUser: getUser,
40 getUsers: getUsers, 41 getUsers: getUsers,
@@ -64,6 +65,10 @@ function getAccessToken (bearerToken, callback) {
64 return OAuthTokensDB.findOne({ accessToken: bearerToken }).populate('user') 65 return OAuthTokensDB.findOne({ accessToken: bearerToken }).populate('user')
65} 66}
66 67
68function getFirstClient (callback) {
69 return OAuthClientsDB.findOne({}, callback)
70}
71
67function getClient (clientId, clientSecret) { 72function getClient (clientId, clientSecret) {
68 logger.debug('Getting Client (clientId: ' + clientId + ', clientSecret: ' + clientSecret + ').') 73 logger.debug('Getting Client (clientId: ' + clientId + ', clientSecret: ' + clientSecret + ').')
69 74