From 0847395c92dfb258bd0e5eefbf8f8cdc910f411c Mon Sep 17 00:00:00 2001 From: KernelDeimos Date: Sun, 14 Apr 2024 23:10:23 -0400 Subject: [PATCH] Socket --- packages/backend/src/routers/change_email.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/backend/src/routers/change_email.js b/packages/backend/src/routers/change_email.js index ccc83b46..0eb09071 100644 --- a/packages/backend/src/routers/change_email.js +++ b/packages/backend/src/routers/change_email.js @@ -110,6 +110,11 @@ const CHANGE_EMAIL_CONFIRM = eggspress('/change_email/confirm', { [new_email, user_id] ); + let socketio = require('../socketio.js').getio(); + if(socketio){ + socketio.to(user.id).emit('user.email_changed', {}) + } + const h = `

Your email has been successfully confirmed.

`; return res.send(h); });