2 Commits

Author SHA1 Message Date
Ajay
1eedc9fa09 Remove old test 2025-10-03 15:13:31 -04:00
Ajay
c1fc6519b4 Remove username restriction 2025-10-03 15:09:02 -04:00
2 changed files with 0 additions and 16 deletions

View File

@@ -70,16 +70,6 @@ export async function setUsername(req: Request, res: Response): Promise<Response
if (await isUserBanned(hashedUserID)) {
return res.sendStatus(200);
}
const [segments, titles, thumbs] = await Promise.all([
db.prepare("get", `SELECT count(*) AS "count" FROM "sponsorTimes" WHERE "userID" = ? LIMIT 1`, [hashedUserID]),
db.prepare("get", `SELECT count(*) AS "count" FROM "titles" WHERE "userID" = ? LIMIT 1`, [hashedUserID]),
db.prepare("get", `SELECT count(*) AS "count" FROM "thumbnails" WHERE "userID" = ? LIMIT 1`, [hashedUserID]),
]) as {count: number}[];
if (segments.count === 0 && titles.count === 0 && thumbs.count === 0) {
return res.sendStatus(200);
}
}
}
catch (error) /* istanbul ignore next */ {

View File

@@ -223,10 +223,4 @@ describe("setUsername", () => {
assert.strictEqual(resp.status, 200);
await assert.rejects(getUsernameInfo(publicID), "Expected the username change to be silently rejected");
});
it("Should ignore username change requests for new users", async () => {
const resp = await postSetUserName(completelyNewUserPrivId, completelyNewUsername);
assert.strictEqual(resp.status, 200);
await assert.rejects(getUsernameInfo(getHash(completelyNewUserPrivId)), "Expected the username change to be silently rejected");
});
});