diff options
author | Chocobozzz <me@florianbigard.com> | 2019-10-25 13:54:32 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-10-25 13:54:32 +0200 |
commit | 4ce7eb71ba28a563336c07d10c182ff89461c72b (patch) | |
tree | 9350704adae97d145548d0b2cfdde3bd95b56dd5 /server/controllers/api/config.ts | |
parent | 45863288582a788def282ec25d437b1795510315 (diff) | |
download | PeerTube-4ce7eb71ba28a563336c07d10c182ff89461c72b.tar.gz PeerTube-4ce7eb71ba28a563336c07d10c182ff89461c72b.tar.zst PeerTube-4ce7eb71ba28a563336c07d10c182ff89461c72b.zip |
Add plugin hook on registration
Diffstat (limited to 'server/controllers/api/config.ts')
-rw-r--r-- | server/controllers/api/config.ts | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/server/controllers/api/config.ts b/server/controllers/api/config.ts index 39a124fc5..113c1e9db 100644 --- a/server/controllers/api/config.ts +++ b/server/controllers/api/config.ts | |||
@@ -17,6 +17,7 @@ import { objectConverter } from '../../helpers/core-utils' | |||
17 | import { CONFIG, reloadConfig } from '../../initializers/config' | 17 | import { CONFIG, reloadConfig } from '../../initializers/config' |
18 | import { PluginManager } from '../../lib/plugins/plugin-manager' | 18 | import { PluginManager } from '../../lib/plugins/plugin-manager' |
19 | import { getThemeOrDefault } from '../../lib/plugins/theme-utils' | 19 | import { getThemeOrDefault } from '../../lib/plugins/theme-utils' |
20 | import { Hooks } from '@server/lib/plugins/hooks' | ||
20 | 21 | ||
21 | const configRouter = express.Router() | 22 | const configRouter = express.Router() |
22 | 23 | ||
@@ -47,7 +48,12 @@ configRouter.delete('/custom', | |||
47 | let serverCommit: string | 48 | let serverCommit: string |
48 | 49 | ||
49 | async function getConfig (req: express.Request, res: express.Response) { | 50 | async function getConfig (req: express.Request, res: express.Response) { |
50 | const allowed = await isSignupAllowed() | 51 | const { allowed } = await Hooks.wrapPromiseFun( |
52 | isSignupAllowed, | ||
53 | {}, | ||
54 | 'filter:api.user.signup.allowed.result' | ||
55 | ) | ||
56 | |||
51 | const allowedForCurrentIP = isSignupAllowedForCurrentIP(req.ip) | 57 | const allowedForCurrentIP = isSignupAllowedForCurrentIP(req.ip) |
52 | const defaultTheme = getThemeOrDefault(CONFIG.THEME.DEFAULT, DEFAULT_THEME_NAME) | 58 | const defaultTheme = getThemeOrDefault(CONFIG.THEME.DEFAULT, DEFAULT_THEME_NAME) |
53 | 59 | ||