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

@@ -6,6 +6,7 @@ import {
MyNotificationHistoryDocument,
SendTestMessengerMessageDocument,
} from '~/composables/graphql/generated';
import { buildMessengerBotStartUrl } from '~/composables/useMessengerBotLink';
const selectedChannel = ref<'TELEGRAM' | 'MAX'>('TELEGRAM');
const customMessage = ref('Тест канала уведомлений Fregat');
@@ -55,9 +56,7 @@ function buildBotConnectUrl(baseUrl: string) {
return '';
}
const payload = encodeURIComponent(`login:${email}`);
const separator = baseUrl.includes('?') ? '&' : '?';
return `${baseUrl}${separator}start=${payload}`;
return buildMessengerBotStartUrl(baseUrl, email);
}
const telegramConnectUrl = computed(() => buildBotConnectUrl(config.public.telegramBotUrl || ''));