From 75424dba473925b99d993d0e52f33067f14125ce Mon Sep 17 00:00:00 2001 From: "Artem (OpenIN)" Date: Mon, 3 Aug 2026 18:23:16 +0000 Subject: [PATCH] refactor(auth): consolidate three Telegram entry points into two MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Drop the passive '@bot_username' link (opens the bot chat with no auth purpose) for the common case — it's now redundant with the new 'Login via bot' button, which offers the same open-bot action plus QR and actual authentication. - Keep the referral deep link (bot start=) only when a referralCode prop is present — that's a distinct registration flow for not-yet-registered users, not a login method. - Add an 'or' divider between the widget and the manual deep-link button so the two remaining options read as equal alternatives rather than a stack of similar-looking Telegram links. - Shorten the deep-link button label to 'Login via bot' — the no-phone-number framing is already implied and shown once the flow starts. No changes to the OIDC/widget button logic itself. --- src/components/TelegramLoginButton.tsx | 36 +++++++++++++++----------- src/locales/en.json | 2 +- src/locales/ru.json | 2 +- 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/src/components/TelegramLoginButton.tsx b/src/components/TelegramLoginButton.tsx index e388376..05d79de 100644 --- a/src/components/TelegramLoginButton.tsx +++ b/src/components/TelegramLoginButton.tsx @@ -578,33 +578,39 @@ export default function TelegramLoginButton({ referralCode }: TelegramLoginButto
)} -
-

{t('auth.orOpenInApp')}

+ {/* Referral deep link — only relevant for not-yet-registered users who + arrived via a referral link; the bot itself handles registering + them with the code attached. Hidden otherwise to avoid a third, + visually-identical "Telegram" entry point next to the two auth + methods below. */} + {referralCode && ( - - - - @{botUsername} + {t('auth.orOpenInApp')} @{botUsername} + )} + +
+
+ {t('common.or')} +
{/* Manual opt-in: same deep-link flow used as the anti-block fallback, - offered here as an explicit alternative for users who'd rather - confirm in the bot than type a phone number into the widget. */} + offered here as an explicit equal alternative to the widget for + users who'd rather confirm in the bot than type a phone number. */}
diff --git a/src/locales/en.json b/src/locales/en.json index 8bd981e..80e72e4 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -208,7 +208,7 @@ "loginFailed": "Login Failed", "telegramWidgetBlocked": "Telegram login widget is unavailable. Use the bot to sign in:", "deepLinkIntro": "Confirm sign-in right in the bot — no phone number needed:", - "loginWithBot": "Login via bot (no phone number)", + "loginWithBot": "Login via bot", "backToWidget": "Back to widget login", "openBotToLogin": "Open bot to sign in", "waitingForConfirmation": "Waiting for confirmation...", diff --git a/src/locales/ru.json b/src/locales/ru.json index 971a829..2feebe2 100644 --- a/src/locales/ru.json +++ b/src/locales/ru.json @@ -211,7 +211,7 @@ "loginFailed": "Ошибка входа", "telegramWidgetBlocked": "Виджет входа через Telegram недоступен. Войдите через бота:", "deepLinkIntro": "Подтвердите вход прямо в боте — без ввода номера телефона:", - "loginWithBot": "Войти через бота (без номера телефона)", + "loginWithBot": "Войти через бота", "backToWidget": "Назад к входу через виджет", "openBotToLogin": "Открыть бота для входа", "waitingForConfirmation": "Ожидание подтверждения...",