mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-12-02 17:13:33 +01:00
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
c91e662034
47 files changed
+4699
-375
No files matched your search
@@ -1259,9 +1259,12 @@ router.get("/users", async (req, res) => {
|
||||
|
||||
res.json({ query: filter, page, total, sort, results, statusCounts });
|
||||
});
|
||||
// Log records carry the internal user _id, never the username; accept either.
|
||||
function adminUserFilter(param: string) {
|
||||
return /^[a-f0-9]{24}$/.test(param) ? { $or: [{ username: param }, { _id: param }] } : { username: param };
|
||||
// Log records carry the internal user _id, never the username. An _id is
|
||||
// asked for explicitly as "id:<_id>": a GitHub login can also be 24 hex
|
||||
// characters, and ban or promote must never hit a different account.
|
||||
export function adminUserFilter(param: string) {
|
||||
const id = /^id:([a-f0-9]{24})$/.exec(param);
|
||||
return id ? { _id: id[1] } : { username: param };
|
||||
}
|
||||
|
||||
router.get(
|
||||
|
||||
Reference in new issue
Block a user