Skip to content

Node.js based forum software built for the modern web

fix: revert breaking change, add back SocketUser.emailConfirm

Julian Lam9ee30fe7d24f
diff --git a/src/socket.io/user.js b/src/socket.io/user.js
index d82785b042..4f5c616114 100644
--- a/src/socket.io/user.js
+++ b/src/socket.io/user.js
@@ -16,6 +16,7 @@ const db = require('../database');
const userController = require('../controllers/user');
const privileges = require('../privileges');
const utils = require('../utils');
+const sockets = require('.');
const SocketUser = module.exports;
@@ -24,6 +25,16 @@ require('./user/status')(SocketUser);
require('./user/picture')(SocketUser);
require('./user/registration')(SocketUser);
+SocketUser.emailConfirm = async function (socket) {
+ sockets.warnDeprecated(socket, 'HTTP 302 /me/edit/email');
+
+ if (!socket.uid) {
+ throw new Error('[[error:no-privileges]]');
+ }
+
+ return await user.email.sendValidationEmail(socket.uid);
+};
+
// Password Reset
SocketUser.reset = {};