Fixed 267U.pre2

This commit is contained in:
2026-07-26 18:25:37 +09:00
parent 50bfaeafdf
commit 317d00a284
1286 changed files with 80222 additions and 1 deletions
@@ -0,0 +1,26 @@
import { Users, UserProfiles } from "../../../models/index.js";
import { publishMainStream } from "../../../services/stream.js";
export default (async (ctx)=>{
const body = ctx.request.body;
const code = body["code"];
const profile = await UserProfiles.findOneByOrFail({
emailVerifyCode: code
});
if (profile != null) {
ctx.body = "Verify succeeded!";
await UserProfiles.update({
userId: profile.userId
}, {
emailVerified: true,
emailVerifyCode: null
});
publishMainStream(profile.userId, "meUpdated", await Users.pack(profile.userId, {
id: profile.userId
}, {
detail: true,
includeSecrets: true
}));
} else {
ctx.throw(404);
}
});