user getBackendUserCore

This commit is contained in:
notmd
2023-01-22 16:01:01 +07:00
parent 952c61f461
commit 554e730d34
+3 -1
View File
@@ -1,10 +1,12 @@
import { withoutRole } from "src/lib/auth";
import { getBackendUserCore } from "src/lib/users";
const handler = withoutRole("banned", async (req, res, token) => {
//TODO: add params if needed
const user = await getBackendUserCore(token.sub);
const params = new URLSearchParams({
username: token.sub,
auth_method: "local",
auth_method: user.auth_method,
});
const messagesRes = await fetch(`${process.env.FASTAPI_URL}/api/v1/messages?${params}`, {