1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 10:49:28 +02:00

Add plugin hook on registration

This commit is contained in:
Chocobozzz 2019-10-25 13:54:32 +02:00
parent 4586328858
commit 4ce7eb71ba
No known key found for this signature in database
GPG key ID: 583A612D890159BE
6 changed files with 60 additions and 10 deletions

View file

@ -17,6 +17,7 @@ import { objectConverter } from '../../helpers/core-utils'
import { CONFIG, reloadConfig } from '../../initializers/config'
import { PluginManager } from '../../lib/plugins/plugin-manager'
import { getThemeOrDefault } from '../../lib/plugins/theme-utils'
import { Hooks } from '@server/lib/plugins/hooks'
const configRouter = express.Router()
@ -47,7 +48,12 @@ configRouter.delete('/custom',
let serverCommit: string
async function getConfig (req: express.Request, res: express.Response) {
const allowed = await isSignupAllowed()
const { allowed } = await Hooks.wrapPromiseFun(
isSignupAllowed,
{},
'filter:api.user.signup.allowed.result'
)
const allowedForCurrentIP = isSignupAllowedForCurrentIP(req.ip)
const defaultTheme = getThemeOrDefault(CONFIG.THEME.DEFAULT, DEFAULT_THEME_NAME)