refactor(auth): unify messenger bot link flow across login/profile/notifications

This commit is contained in:
Ruslan Bakiev
2026-04-02 16:12:34 +07:00
parent b0f461a74e
commit f4a4b41dd5
4 changed files with 21 additions and 18 deletions

View File

@@ -0,0 +1,10 @@
export function buildMessengerBotStartUrl(baseUrl: string, email: string) {
const normalizedEmail = email.trim().toLowerCase();
if (!baseUrl || !normalizedEmail) {
return '';
}
const payload = encodeURIComponent(`login:${normalizedEmail}`);
const separator = baseUrl.includes('?') ? '&' : '?';
return `${baseUrl}${separator}start=${payload}`;
}