fix: RateLimit verify email and fix (#23718)

* fix: RateLimit verify email

* update

* client chnages

* type error

* fix

* add test

* Update event-types.e2e.ts

* minor update

* Update event-types.e2e.ts

* fix test

* handle it in api v2
This commit is contained in:
Anik Dhabal Babu authored and GitHub committed 2025-09-12 18:27:05 +01:00
1 parent 79169de8d8
commit ee70111c45
14 files changed
+456 -22

No files matched your search

+5 -3
View File
@@ -7,7 +7,9 @@ export interface PiiHasher {
export class Md5PiiHasher implements PiiHasher {
constructor(private readonly salt: string) {}
hash(input: string) {
return createHash("md5").update(this.salt + input).digest("hex");
return createHash("md5")
.update(this.salt + input)
.digest("hex");
}
}
@@ -16,5 +18,5 @@ export const piiHasher: PiiHasher = new Md5PiiHasher(process.env.CALENDSO_ENCRYP
export const hashEmail = (email: string, hasher: PiiHasher = piiHasher): string => {
const [localPart, domain] = email.split("@");
// Simple hash function for email, can be replaced with a more complex one if needed
return hasher.hash(localPart) + "@" + domain;
}
return `${hasher.hash(localPart)}@${domain}`;
};