diff --git a/userfront/lib/core/services/auth_proxy_service.dart b/userfront/lib/core/services/auth_proxy_service.dart index 92ca4a40..833cee12 100644 --- a/userfront/lib/core/services/auth_proxy_service.dart +++ b/userfront/lib/core/services/auth_proxy_service.dart @@ -238,12 +238,19 @@ class AuthProxyService { } } - static Future> acceptConsent(String consentChallenge) async { + static Future> acceptConsent(String consentChallenge, {List? grantScope}) async { final url = Uri.parse('$_baseUrl/api/v1/auth/consent/accept'); + final body = { + 'consent_challenge': consentChallenge, + }; + if (grantScope != null) { + body['grant_scope'] = grantScope; + } + final response = await http.post( url, headers: {'Content-Type': 'application/json'}, - body: jsonEncode({'consent_challenge': consentChallenge}), + body: jsonEncode(body), ); if (response.statusCode == 200) {