diff --git a/userfront/lib/core/services/auth_proxy_service.dart b/userfront/lib/core/services/auth_proxy_service.dart index 833cee12..3a71817c 100644 --- a/userfront/lib/core/services/auth_proxy_service.dart +++ b/userfront/lib/core/services/auth_proxy_service.dart @@ -261,6 +261,26 @@ class AuthProxyService { } } + static Future> rejectConsent(String consentChallenge) async { + final url = Uri.parse('$_baseUrl/api/v1/auth/consent/reject'); + final body = { + 'consent_challenge': consentChallenge, + }; + + final response = await http.post( + url, + headers: {'Content-Type': 'application/json'}, + body: jsonEncode(body), + ); + + if (response.statusCode == 200) { + return jsonDecode(response.body); + } else { + final errorBody = jsonDecode(response.body); + throw Exception(errorBody['error'] ?? 'Failed to reject consent'); + } + } + static Future> acceptOidcLogin( String loginChallenge, { String? token,