aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/fixtures/peertube-plugin-test-id-pass-auth-two/main.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/fixtures/peertube-plugin-test-id-pass-auth-two/main.js')
-rw-r--r--server/tests/fixtures/peertube-plugin-test-id-pass-auth-two/main.js36
1 files changed, 36 insertions, 0 deletions
diff --git a/server/tests/fixtures/peertube-plugin-test-id-pass-auth-two/main.js b/server/tests/fixtures/peertube-plugin-test-id-pass-auth-two/main.js
new file mode 100644
index 000000000..edfc870c0
--- /dev/null
+++ b/server/tests/fixtures/peertube-plugin-test-id-pass-auth-two/main.js
@@ -0,0 +1,36 @@
1async function register ({
2 registerIdAndPassAuth,
3 peertubeHelpers
4}) {
5 registerIdAndPassAuth({
6 type: 'id-and-pass',
7
8 onLogout: () => {
9 peertubeHelpers.logger.info('On logout for auth 2 - 1')
10 },
11
12 getWeight: () => 30,
13
14 login (body) {
15 if (body.id === 'laguna' && body.password === 'laguna password') {
16 return Promise.resolve({
17 username: 'laguna',
18 email: 'laguna@example.com'
19 })
20 }
21
22 return null
23 }
24 })
25}
26
27async function unregister () {
28 return
29}
30
31module.exports = {
32 register,
33 unregister
34}
35
36// ###########################################################################