Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

fill_login: keep registration pages out of the new-password fallback

AdityaUmale38eb1795f293
diff --git a/server/login-fill.test.ts b/server/login-fill.test.ts
index d6abdf98b7..64095a3bfd 100644
--- a/server/login-fill.test.ts
+++ b/server/login-fill.test.ts
@@ -354,7 +354,7 @@ describe("one-time codes and fields", () => {
it("keeps new-password boxes empty on a sign-in page with two of them, or on a sign-up page under a sign-in path", async () => {
const twoBoxes = `<form><input name="email" type="email"><input name="new" type="password" autocomplete="new-password"><input name="again" type="password" autocomplete="new-password"></form>`;
const oneBox = `<form><input name="email" type="email"><input name="new" type="password" autocomplete="new-password"></form>`;
- for (const [url, html] of [["https://example.com/login", twoBoxes], ["https://example.com/login/signup", oneBox], ["https://example.com/signin/reset-password", oneBox]]) {
+ for (const [url, html] of [["https://example.com/login", twoBoxes], ["https://example.com/login/signup", oneBox], ["https://example.com/signin/reset-password", oneBox], ["https://example.com/login/registration", oneBox]]) {
const { page, fill } = setup(url, html, [{ host: "example.com", username: "[email protected]" }], { submit: false });
const outcome = await fill();
expect(outcome).toMatchObject({ ok: true, filled: ["username"] });
diff --git a/server/login-fill.ts b/server/login-fill.ts
index a474a2952e..a46a8aae88 100644
--- a/server/login-fill.ts
+++ b/server/login-fill.ts
@@ -176,7 +176,7 @@ const FIND_FIELDS = `((nonce, step) => {
// Some sign-in forms (TikTok's) mark their only password box new-password.
const steps = location.pathname.toLowerCase().split("/");
const signIn = steps.some((step) => ["login", "log-in", "signin", "sign-in"].includes(step)) &&
- !steps.some((step) => ["signup", "sign-up", "register", "join", "reset", "forgot", "change"].some((word) => step.includes(word)));
+ !steps.some((step) => ["signup", "sign-up", "register", "registration", "join", "reset", "forgot", "change"].some((word) => step.includes(word)));
const password = passwords.find((el) => tokens(el).includes("current-password")) || passwords[0] ||
(signIn && fresh.length === 1 ? fresh[0] : null);
const USER = /user|e-?mail|login|account|identifier|phone|mobile/;