Add moderator bots and editable MineGeo usernames
All checks were successful
Deploy MineGeo to Dokploy / deploy (push) Successful in 3m27s

This commit is contained in:
2026-10-29 16:32:55 +05:00
parent 658c8974ac
commit 50b27cf498
19 changed files with 654 additions and 10 deletions

View File

@@ -6,7 +6,16 @@ import {
displayNameSchema,
newPasswordSchema,
profileUpdateSchema,
usernameSchema,
} from "../shared/account";
test("usernames are normalized, unique-key compatible and changeable through profile updates", () => {
assert.equal(usernameSchema.parse(" Perfect_Python500 "), "perfect_python500");
assert.deepEqual(profileUpdateSchema.parse({ username: "New_Name" }), { username: "new_name" });
for (const bad of ["ab", "a".repeat(33), "name space", "name@server", "юзер", "a\nb"]) assert.equal(usernameSchema.safeParse(bad).success, false);
const path = "/moderator-application/" + "a".repeat(64);
assert.equal(authDestination(path), path);
assert.equal(authDestination(path + "?next=https://evil.example"), "/dashboard");
});
import {
createRecoveryGrant,
verifyRecoveryGrant,