diff options
Diffstat (limited to 'server/tests/utils/login.js')
-rw-r--r-- | server/tests/utils/login.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/server/tests/utils/login.js b/server/tests/utils/login.js index 465564e14..c984c0baf 100644 --- a/server/tests/utils/login.js +++ b/server/tests/utils/login.js | |||
@@ -4,7 +4,8 @@ const request = require('supertest') | |||
4 | 4 | ||
5 | const loginUtils = { | 5 | const loginUtils = { |
6 | login, | 6 | login, |
7 | loginAndGetAccessToken | 7 | loginAndGetAccessToken, |
8 | getUserAccessToken | ||
8 | } | 9 | } |
9 | 10 | ||
10 | // ---------------------- Export functions -------------------- | 11 | // ---------------------- Export functions -------------------- |
@@ -43,6 +44,14 @@ function loginAndGetAccessToken (server, callback) { | |||
43 | }) | 44 | }) |
44 | } | 45 | } |
45 | 46 | ||
47 | function getUserAccessToken (server, user, callback) { | ||
48 | login(server.url, server.client, user, 200, function (err, res) { | ||
49 | if (err) return callback(err) | ||
50 | |||
51 | return callback(null, res.body.access_token) | ||
52 | }) | ||
53 | } | ||
54 | |||
46 | // --------------------------------------------------------------------------- | 55 | // --------------------------------------------------------------------------- |
47 | 56 | ||
48 | module.exports = loginUtils | 57 | module.exports = loginUtils |