mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-23 04:34:15 -04:00
(fix) user banners cache doesn't get invalidated after chaging avatar
This commit is contained in:
parent
c56c59abf1
commit
a690f33a2e
@ -18,6 +18,7 @@ import copyAvatar from '../avatarCopy.js';
|
||||
import { usernameRegex, usernameUnsafeRegex } from '../../src/username.ts';
|
||||
const config = loadSuml('config');
|
||||
import auditLog from '../audit.ts';
|
||||
import {CacheObject} from "../../src/cache.js";
|
||||
|
||||
export const normalise = (s) => s.trim().toLowerCase();
|
||||
|
||||
@ -723,6 +724,8 @@ router.post('/user/set-avatar', handleErrorAsync(async (req, res) => {
|
||||
|
||||
await resetCards(req.db, req.user.id);
|
||||
|
||||
await new CacheObject('banner', `@${req.user.username}.png`, 24 * 60).invalidate();
|
||||
|
||||
await auditLog(req, 'auth/changed_avatar', { source: req.body.source });
|
||||
|
||||
return res.json({ token: await issueAuthentication(req.db, req.user) });
|
||||
|
Loading…
x
Reference in New Issue
Block a user