From 4ce7eb71ba28a563336c07d10c182ff89461c72b Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 25 Oct 2019 13:54:32 +0200 Subject: Add plugin hook on registration --- server/tests/fixtures/peertube-plugin-test/main.js | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'server/tests/fixtures/peertube-plugin-test') 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 return false } }) + + registerHook({ + target: 'filter:api.user.signup.allowed.result', + handler: (result, params) => { + if (params && params.body.email.includes('jma')) { + return { allowed: false, errorMessage: 'No jma' } + } + + return result + } + }) } async function unregister () { -- cgit v1.2.3