🪻 distributed transcription service thistle.dunkirk.sh

feat: remove client side email check and add dummy comparison for non existant users

dunkirk.sh 00ea745e 805ae8bc

verified
Changed files
+6 -11
src
components
lib
-10
src/components/auth.ts
···
if (!response.ok) {
const data = await response.json();
-
-
if (
-
response.status === 401 &&
-
data.error?.includes("Invalid email")
-
) {
-
this.needsRegistration = true;
-
this.error = "";
-
return;
-
}
-
this.error = data.error || "Login failed";
return;
}
+6 -1
src/lib/auth.ts
···
)
.get(email);
-
if (!result) return null;
+
if (!result) {
+
// Dummy comparison to prevent timing-based account enumeration
+
const dummyHash = "0".repeat(64);
+
password === dummyHash;
+
return null;
+
}
if (password !== result.password_hash) return null;