diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-04-27 22:11:48 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-04-27 22:11:48 +0200 |
commit | 23a5a916dba8960e77e0dcc9f9050e0df0a5f60b (patch) | |
tree | 4b13e967a5b9715ba2c6b74681f13e6ccdfa86e4 /server/models | |
parent | 2693922352c23401b658720251db2966c92614bb (diff) | |
download | PeerTube-23a5a916dba8960e77e0dcc9f9050e0df0a5f60b.tar.gz PeerTube-23a5a916dba8960e77e0dcc9f9050e0df0a5f60b.tar.zst PeerTube-23a5a916dba8960e77e0dcc9f9050e0df0a5f60b.zip |
Make angular client load dynamically the generated client id/secret
Diffstat (limited to 'server/models')
-rw-r--r-- | server/models/users.js | 5 |
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 | ||
68 | function getFirstClient (callback) { | ||
69 | return OAuthClientsDB.findOne({}, callback) | ||
70 | } | ||
71 | |||
67 | function getClient (clientId, clientSecret) { | 72 | function getClient (clientId, clientSecret) { |
68 | logger.debug('Getting Client (clientId: ' + clientId + ', clientSecret: ' + clientSecret + ').') | 73 | logger.debug('Getting Client (clientId: ' + clientId + ', clientSecret: ' + clientSecret + ').') |
69 | 74 | ||