mirror of
https://github.com/HeyPuter/puter
synced 2024-11-15 06:15:47 +00:00
Invalidate cached user when the user's email address is changed
This commit is contained in:
parent
2fcac12340
commit
e71b586fe5
@ -26,6 +26,7 @@ const { DB_READ, DB_WRITE } = require('../services/database/consts.js');
|
||||
const config = require('../config.js');
|
||||
|
||||
const jwt = require('jsonwebtoken');
|
||||
const { invalidate_cached_user_by_id } = require('../helpers.js');
|
||||
|
||||
const CHANGE_EMAIL_START = eggspress('/change_email/start', {
|
||||
subdomain: 'api',
|
||||
@ -110,6 +111,7 @@ const CHANGE_EMAIL_CONFIRM = eggspress('/change_email/confirm', {
|
||||
[new_email, user_id]
|
||||
);
|
||||
|
||||
invalidate_cached_user_by_id(user_id);
|
||||
let socketio = require('../socketio.js').getio();
|
||||
if(socketio){
|
||||
socketio.to(user_id).emit('user.email_changed', {})
|
||||
|
Loading…
Reference in New Issue
Block a user