Download api/server/middleware/validateRegistration.js from Zhitomir/chat: direct link, hf CLI and curl.
- Browser
- Download file 276 Bytes
-
https://huggingface.co/spaces/Zhitomir/chat/resolve/main/api/server/middleware/validateRegistration.js
- Command line
-
hf download hf://spaces/Zhitomir/chat/api/server/middleware/validateRegistration.js
-
curl -L -o validateRegistration.js https://huggingface.co/spaces/Zhitomir/chat/resolve/main/api/server/middleware/validateRegistration.js
276 Bytes
| const { isEnabled } = require('~/server/utils'); | |
| function validateRegistration(req, res, next) { | |
| if (isEnabled(process.env.ALLOW_REGISTRATION)) { | |
| next(); | |
| } else { | |
| res.status(403).send('Registration is not allowed.'); | |
| } | |
| } | |
| module.exports = validateRegistration; | |