bump beta.10

This commit is contained in:
undefined committed 2025-10-19 20:13:27 +08:00
1 parent e33575343c
commit a8246eacd6
27 files changed
+143 -112

No files matched your search

+4 -1
View File
@@ -1,5 +1,5 @@
import type { KoaContext } from '@hydrooj/framework';
import { PERM } from '../../model/builtin';
import { PERM, PRIV } from '../../model/builtin';
import UserModel from '../../model/user';
export default async (ctx: KoaContext, next) => {
@@ -13,6 +13,9 @@ export default async (ctx: KoaContext, next) => {
user = await UserModel.getById(domainId, ctx.session.uid, ctx.session.scope);
}
if (user._id === 0) delete user.viewLang;
else if (!user._udoc.ip.includes(ctx.request.ip) && user.hasPriv(PRIV.PRIV_USER_PROFILE)) {
await UserModel.setById(user._id, { loginip: ctx.request.ip });
}
ctx.HydroContext.user = await user.private();
await next();
};