From 09a00a41adaa887c6ed81990fa4affd064aec09f Mon Sep 17 00:00:00 2001 From: misha Date: Tue, 14 Oct 2025 12:09:26 +0300 Subject: [PATCH] added scopes for yandex id --- lib/features/auth/sdk/social_auth_facade.dart | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/lib/features/auth/sdk/social_auth_facade.dart b/lib/features/auth/sdk/social_auth_facade.dart index b7f4f93d..4cab0962 100644 --- a/lib/features/auth/sdk/social_auth_facade.dart +++ b/lib/features/auth/sdk/social_auth_facade.dart @@ -91,21 +91,6 @@ class SocialAuthFacade { ); } - Future?> exchangeCodeForToken(String code, String clientId, String clientSecret) async { - final response = await http.post( - Uri.parse('https://oauth.yandex.ru/token'), - headers: {'Content-Type': 'application/x-www-form-urlencoded'}, - body: {'grant_type': 'authorization_code', 'code': code, 'client_id': clientId, 'client_secret': clientSecret}, - ); - - if (response.statusCode == 200) { - return jsonDecode(response.body) as Map; - } else { - log('Error exchanging code: ${response.body}'); - } - return null; - } - static Future signInWithOkAndFetchProfile() async { final context = AppRouter.navigatorKey.currentContext; if (context == null) return null; @@ -134,7 +119,8 @@ class SocialAuthFacade { 'response_type': 'code', 'client_id': clientId, 'redirect_uri': redirectUri, - 'force_confirm': 'yes', + 'scope': 'login:info login:email', + 'force_confirm': 'true', }).toString(); final redirectSchemePrefix = redirectUri;