diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-01-12 15:20:03 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-01-12 15:20:03 +0100 |
commit | 99fe265a5fc077cb66c322e7f3d191ff7110aea0 (patch) | |
tree | c9e04ccfcc5496d2300d7c26db5833e494b4cdad /server/tests/utils/login.js | |
parent | fcc5f77b95d330bfcb439c172b7fcc58f3162e4d (diff) | |
parent | 91cc839af88730ba55f84997c56b85ea100070a7 (diff) | |
download | PeerTube-99fe265a5fc077cb66c322e7f3d191ff7110aea0.tar.gz PeerTube-99fe265a5fc077cb66c322e7f3d191ff7110aea0.tar.zst PeerTube-99fe265a5fc077cb66c322e7f3d191ff7110aea0.zip |
Merge branch 'postgresql'
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 |