aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/fixtures/peertube-plugin-test-id-pass-auth-one/main.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/fixtures/peertube-plugin-test-id-pass-auth-one/main.js')
-rw-r--r--server/tests/fixtures/peertube-plugin-test-id-pass-auth-one/main.js69
1 files changed, 0 insertions, 69 deletions
diff --git a/server/tests/fixtures/peertube-plugin-test-id-pass-auth-one/main.js b/server/tests/fixtures/peertube-plugin-test-id-pass-auth-one/main.js
deleted file mode 100644
index f58faa847..000000000
--- a/server/tests/fixtures/peertube-plugin-test-id-pass-auth-one/main.js
+++ /dev/null
@@ -1,69 +0,0 @@
1async function register ({
2 registerIdAndPassAuth,
3 peertubeHelpers,
4 settingsManager,
5 unregisterIdAndPassAuth
6}) {
7 registerIdAndPassAuth({
8 authName: 'spyro-auth',
9
10 onLogout: () => {
11 peertubeHelpers.logger.info('On logout for auth 1 - 1')
12 },
13
14 getWeight: () => 15,
15
16 login (body) {
17 if (body.id === 'spyro' && body.password === 'spyro password') {
18 return Promise.resolve({
19 username: 'spyro',
20 email: 'spyro@example.com',
21 role: 2,
22 displayName: 'Spyro the Dragon'
23 })
24 }
25
26 return null
27 }
28 })
29
30 registerIdAndPassAuth({
31 authName: 'crash-auth',
32
33 onLogout: () => {
34 peertubeHelpers.logger.info('On logout for auth 1 - 2')
35 },
36
37 getWeight: () => 50,
38
39 login (body) {
40 if (body.id === 'crash' && body.password === 'crash password') {
41 return Promise.resolve({
42 username: 'crash',
43 email: 'crash@example.com',
44 role: 1,
45 displayName: 'Crash Bandicoot'
46 })
47 }
48
49 return null
50 }
51 })
52
53 settingsManager.onSettingsChange(settings => {
54 if (settings.disableSpyro) {
55 unregisterIdAndPassAuth('spyro-auth')
56 }
57 })
58}
59
60async function unregister () {
61 return
62}
63
64module.exports = {
65 register,
66 unregister
67}
68
69// ###########################################################################