aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/utils/login.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-12-30 12:23:53 +0100
committerChocobozzz <florian.bigard@gmail.com>2016-12-30 12:23:53 +0100
commitefe923bcdaf15b47593ad8583df09a92c715ac6c (patch)
tree1944856cd35ff8e1845a31ef776d4cf965b4be34 /server/tests/utils/login.js
parent818f7987eba27c59793e2103168b26129c9404f2 (diff)
downloadPeerTube-efe923bcdaf15b47593ad8583df09a92c715ac6c.tar.gz
PeerTube-efe923bcdaf15b47593ad8583df09a92c715ac6c.tar.zst
PeerTube-efe923bcdaf15b47593ad8583df09a92c715ac6c.zip
Server: split check params tests
Diffstat (limited to 'server/tests/utils/login.js')
-rw-r--r--server/tests/utils/login.js11
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
5const loginUtils = { 5const 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
47function 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
48module.exports = loginUtils 57module.exports = loginUtils