Complete Telegram bot login from callback URL
All checks were successful
Build and deploy Flutter Web / build (push) Successful in 2m18s

This commit is contained in:
Ruslan Bakiev
2026-05-13 19:36:09 +07:00
parent 5b2cd4158c
commit a8b6aa6e02
5 changed files with 23 additions and 82 deletions

View File

@@ -126,14 +126,11 @@ class MapflowApi {
);
}
Future<TelegramBotLoginStatus> fetchTelegramBotLoginStatus(
String token,
) async {
Future<TelegramBotLoginSession> completeTelegramBotLogin(String token) async {
final data = await _graphql(
'''
query TelegramBotLoginStatus(\$token: String!) {
telegramBotLoginStatus(token: \$token) {
status
mutation CompleteTelegramBotLogin(\$token: String!) {
completeTelegramBotLogin(token: \$token) {
sessionToken
user {
id
@@ -149,8 +146,8 @@ class MapflowApi {
''',
variables: {'token': token},
);
return TelegramBotLoginStatus.fromJson(
data['telegramBotLoginStatus'] as Map<String, dynamic>,
return TelegramBotLoginSession.fromJson(
data['completeTelegramBotLogin'] as Map<String, dynamic>,
);
}