mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-30 02:23:47 +00:00
feat: account merge flow — merge redirect, error handling, server-complete linking
- Добавлен merge_required + merge_token redirect в OAuthCallback и LinkTelegramCallback - Server-complete OAuth linking для Mini App (внешний браузер) - getErrorDetail: единый экстрактор ошибок из axios response - LinkTelegramCallback: типизированный catch с getErrorDetail - Удалён мёртвый экспорт getAndClearOAuthState - CSRF валидация для Telegram и OAuth linking flows - Типы ServerCompleteResponse, LinkCallbackResponse
This commit is contained in:
@@ -4,6 +4,7 @@ import { useTranslation } from 'react-i18next';
|
||||
import { authApi } from '../api/auth';
|
||||
import { useToast } from '../components/Toast';
|
||||
import { LINK_TELEGRAM_STATE_KEY } from './ConnectedAccounts';
|
||||
import { getErrorDetail } from './OAuthCallback';
|
||||
|
||||
export default function LinkTelegramCallback() {
|
||||
const { t } = useTranslation();
|
||||
@@ -69,8 +70,11 @@ export default function LinkTelegramCallback() {
|
||||
showToast({ type: 'success', message: t('profile.accounts.linkSuccess') });
|
||||
navigate('/profile/accounts', { replace: true });
|
||||
}
|
||||
} catch {
|
||||
showToast({ type: 'error', message: t('profile.accounts.linkError') });
|
||||
} catch (err: unknown) {
|
||||
showToast({
|
||||
type: 'error',
|
||||
message: getErrorDetail(err) || t('profile.accounts.linkError'),
|
||||
});
|
||||
navigate('/profile/accounts', { replace: true });
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user