🐛 fix CORS
This commit is contained in:
@@ -34,6 +34,7 @@ router.post(
|
||||
gift_code_sku_id, // ? what is this
|
||||
captcha_key
|
||||
} = req.body;
|
||||
console.log("register", req.body.email, req.body.username, req.headers["cf-connecting-ip"]);
|
||||
// TODO: automatically join invite
|
||||
// TODO: gift_code_sku_id?
|
||||
// TODO: check password strength
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Router, Request, Response } from "express";
|
||||
import { UserModel, toObject } from "@fosscord/server-util";
|
||||
import { UserModel, toObject, PublicUserProjection } from "@fosscord/server-util";
|
||||
import { HTTPError } from "lambert-server";
|
||||
import { getPublicUser } from "../../../util/User";
|
||||
import { UserModifySchema } from "../../../schema/User";
|
||||
@@ -28,7 +28,7 @@ router.patch("/", check(UserModifySchema), async (req: Request, res: Response) =
|
||||
}
|
||||
}
|
||||
|
||||
const user = await UserModel.findOneAndUpdate({ id: req.user_id }, body).exec();
|
||||
const user = await UserModel.findOneAndUpdate({ id: req.user_id }, body, { projection: PublicUserProjection }).exec();
|
||||
// TODO: dispatch user update event
|
||||
|
||||
res.json(toObject(user));
|
||||
|
||||
Reference in New Issue
Block a user