mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
feat: allow file uploading on registration interstitial
This commit is contained in:
@@ -90,9 +90,9 @@
|
|||||||
"nodebb-plugin-spam-be-gone": "0.6.1",
|
"nodebb-plugin-spam-be-gone": "0.6.1",
|
||||||
"nodebb-rewards-essentials": "0.0.13",
|
"nodebb-rewards-essentials": "0.0.13",
|
||||||
"nodebb-theme-lavender": "5.0.9",
|
"nodebb-theme-lavender": "5.0.9",
|
||||||
"nodebb-theme-persona": "9.1.29",
|
"nodebb-theme-persona": "9.1.30",
|
||||||
"nodebb-theme-slick": "1.2.23",
|
"nodebb-theme-slick": "1.2.23",
|
||||||
"nodebb-theme-vanilla": "10.1.25",
|
"nodebb-theme-vanilla": "10.1.26",
|
||||||
"nodebb-widget-essentials": "4.0.17",
|
"nodebb-widget-essentials": "4.0.17",
|
||||||
"nodemailer": "^6.0.0",
|
"nodemailer": "^6.0.0",
|
||||||
"passport": "^0.4.0",
|
"passport": "^0.4.0",
|
||||||
|
|||||||
@@ -152,6 +152,7 @@ authenticationController.registerComplete = function (req, res, next) {
|
|||||||
|
|
||||||
var callbacks = data.interstitials.reduce(function (memo, cur) {
|
var callbacks = data.interstitials.reduce(function (memo, cur) {
|
||||||
if (cur.hasOwnProperty('callback') && typeof cur.callback === 'function') {
|
if (cur.hasOwnProperty('callback') && typeof cur.callback === 'function') {
|
||||||
|
req.body.files = req.files;
|
||||||
memo.push(function (next) {
|
memo.push(function (next) {
|
||||||
cur.callback(req.session.registration, req.body, function (err) {
|
cur.callback(req.session.registration, req.body, function (err) {
|
||||||
// Pass error as second argument so all callbacks are executed
|
// Pass error as second argument so all callbacks are executed
|
||||||
|
|||||||
@@ -120,6 +120,11 @@ Auth.reloadRoutes = function (router, callback) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var multipart = require('connect-multiparty');
|
||||||
|
var multipartMiddleware = multipart();
|
||||||
|
var middlewares = [multipartMiddleware, Auth.middleware.applyCSRF, Auth.middleware.applyBlacklist];
|
||||||
|
|
||||||
|
router.post('/register', middlewares, controllers.authentication.register);
|
||||||
router.post('/register', Auth.middleware.applyCSRF, Auth.middleware.applyBlacklist, controllers.authentication.register);
|
router.post('/register', Auth.middleware.applyCSRF, Auth.middleware.applyBlacklist, controllers.authentication.register);
|
||||||
router.post('/register/complete', Auth.middleware.applyCSRF, Auth.middleware.applyBlacklist, controllers.authentication.registerComplete);
|
router.post('/register/complete', Auth.middleware.applyCSRF, Auth.middleware.applyBlacklist, controllers.authentication.registerComplete);
|
||||||
router.post('/register/abort', controllers.authentication.registerAbort);
|
router.post('/register/abort', controllers.authentication.registerAbort);
|
||||||
|
|||||||
Reference in New Issue
Block a user