aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/config.ts
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/controllers/api/config.ts
parent45863288582a788def282ec25d437b1795510315 (diff)
downloadPeerTube-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.ts8
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'
17import { CONFIG, reloadConfig } from '../../initializers/config' 17import { CONFIG, reloadConfig } from '../../initializers/config'
18import { PluginManager } from '../../lib/plugins/plugin-manager' 18import { PluginManager } from '../../lib/plugins/plugin-manager'
19import { getThemeOrDefault } from '../../lib/plugins/theme-utils' 19import { getThemeOrDefault } from '../../lib/plugins/theme-utils'
20import { Hooks } from '@server/lib/plugins/hooks'
20 21
21const configRouter = express.Router() 22const configRouter = express.Router()
22 23
@@ -47,7 +48,12 @@ configRouter.delete('/custom',
47let serverCommit: string 48let serverCommit: string
48 49
49async function getConfig (req: express.Request, res: express.Response) { 50async 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