mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 09:33:46 +00:00
feat: account linking and merge UI for cabinet
Add Connected Accounts page (link/unlink OAuth providers), Link OAuth Callback handler, and Merge Accounts page with subscription comparison and user choice. Includes API methods, TypeScript types, routes in App.tsx, navigation from Profile, and i18n for all 4 locales (ru, en, zh, fa). Merge page works without JWT auth (validated by merge token).
This commit is contained in:
@@ -636,3 +636,57 @@ export interface PromoGroupSimple {
|
||||
id: number;
|
||||
name: string;
|
||||
}
|
||||
|
||||
// Account Linking
|
||||
export interface LinkedProvider {
|
||||
provider: string;
|
||||
linked: boolean;
|
||||
identifier: string | null;
|
||||
}
|
||||
|
||||
export interface LinkedProvidersResponse {
|
||||
providers: LinkedProvider[];
|
||||
}
|
||||
|
||||
export interface LinkCallbackResponse {
|
||||
success: boolean;
|
||||
message: string | null;
|
||||
merge_required: boolean;
|
||||
merge_token: string | null;
|
||||
}
|
||||
|
||||
// Account Merge
|
||||
export interface MergeSubscriptionPreview {
|
||||
status: string;
|
||||
is_trial: boolean;
|
||||
end_date: string | null;
|
||||
traffic_limit_gb: number;
|
||||
traffic_used_gb: number;
|
||||
device_limit: number;
|
||||
tariff_name: string | null;
|
||||
autopay_enabled: boolean;
|
||||
}
|
||||
|
||||
export interface MergeAccountPreview {
|
||||
id: number;
|
||||
username: string | null;
|
||||
first_name: string | null;
|
||||
email: string | null;
|
||||
auth_methods: string[];
|
||||
balance_kopeks: number;
|
||||
subscription: MergeSubscriptionPreview | null;
|
||||
created_at: string | null;
|
||||
}
|
||||
|
||||
export interface MergePreviewResponse {
|
||||
primary: MergeAccountPreview;
|
||||
secondary: MergeAccountPreview;
|
||||
expires_in_seconds: number;
|
||||
}
|
||||
|
||||
export interface MergeResponse {
|
||||
success: boolean;
|
||||
access_token: string | null;
|
||||
refresh_token: string | null;
|
||||
user: User | null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user