aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/fixtures
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-10-25 13:54:32 +0200
committerChocobozzz <me@florianbigard.com>2019-10-25 13:54:32 +0200
commit4ce7eb71ba28a563336c07d10c182ff89461c72b (patch)
tree9350704adae97d145548d0b2cfdde3bd95b56dd5 /server/tests/fixtures
parent45863288582a788def282ec25d437b1795510315 (diff)
downloadPeerTube-4ce7eb71ba28a563336c07d10c182ff89461c72b.tar.gz
PeerTube-4ce7eb71ba28a563336c07d10c182ff89461c72b.tar.zst
PeerTube-4ce7eb71ba28a563336c07d10c182ff89461c72b.zip
Add plugin hook on registration
Diffstat (limited to 'server/tests/fixtures')
-rw-r--r--server/tests/fixtures/peertube-plugin-test/main.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/server/tests/fixtures/peertube-plugin-test/main.js b/server/tests/fixtures/peertube-plugin-test/main.js
index 7c53f6afe..055884d29 100644
--- a/server/tests/fixtures/peertube-plugin-test/main.js
+++ b/server/tests/fixtures/peertube-plugin-test/main.js
@@ -86,6 +86,17 @@ async function register ({ registerHook, registerSetting, settingsManager, stora
86 return false 86 return false
87 } 87 }
88 }) 88 })
89
90 registerHook({
91 target: 'filter:api.user.signup.allowed.result',
92 handler: (result, params) => {
93 if (params && params.body.email.includes('jma')) {
94 return { allowed: false, errorMessage: 'No jma' }
95 }
96
97 return result
98 }
99 })
89} 100}
90 101
91async function unregister () { 102async function unregister () {