1
0
Fork 0
polaris-task-force/reset-test-user-password.ts
Z8MB1E 3597833843 chore: add local account debugging scripts
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-08-12 16:21:15 -04:00

27 lines
633 B
TypeScript

import { getPayload } from "payload";
import config from "@payload-config";
const payload = await getPayload({ config });
const userRes = await payload.find({
collection: "users",
where: { username: { equals: "mt-msmg3li2-buyer" } },
limit: 1,
overrideAccess: true,
});
if (!userRes.docs[0]) {
console.error("User not found");
process.exit(1);
}
console.log("Found user:", userRes.docs[0].username, userRes.docs[0].id);
await payload.update({
collection: "users",
id: userRes.docs[0].id,
data: { password: "Test123" },
overrideAccess: true,
});
console.log("Password reset complete for mt-msmg3li2-buyer");