Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

mobile: obfuscate short emails

ammarahm-edf9bcfe2f7a03
diff --git a/apps/mobile/app/components/auth/session-expired.js b/apps/mobile/app/components/auth/session-expired.js
index cb6bf2109..8b6a4f12e 100644
--- a/apps/mobile/app/components/auth/session-expired.js
+++ b/apps/mobile/app/components/auth/session-expired.js
@@ -44,8 +44,10 @@ import Paragraph from "../ui/typography/paragraph";
import { LoginSteps, useLogin } from "./use-login";
function getObfuscatedEmail(email) {
- if (!email) return null;
- return email.replace(/(.{2})(.*)(?=@)/, function (gp1, gp2, gp3) {
+ if (!email) return "";
+ const [username, provider] = email.split("@");
+ if (username.length === 1) return `****@${provider}`;
+ return email.replace(/(.{1})(.*)(?=@)/, function (gp1, gp2, gp3) {
for (let i = 0; i < gp3.length; i++) {
gp2 += "*";
}