1
0
forked from baron/baron-sso

연동 ㅎ해지 UI 및 서비스 로직 구현

This commit is contained in:
2026-02-03 17:59:23 +09:00
parent c5cec11c03
commit 0eda7bde13
2 changed files with 122 additions and 9 deletions

View File

@@ -594,6 +594,44 @@ class AuthProxyService {
}
}
static Future<List<dynamic>> fetchLinkedRps() async {
final url = Uri.parse('$_baseUrl/api/v1/user/rp/linked');
final client = createHttpClient(withCredentials: true);
try {
final response = await client.get(
url,
headers: {'Content-Type': 'application/json'},
);
if (response.statusCode == 200) {
final data = jsonDecode(response.body);
return data['items'] ?? [];
} else {
throw Exception('연동된 앱 목록을 불러오지 못했습니다.');
}
} finally {
client.close();
}
}
static Future<void> revokeLinkedRp(String clientId) async {
final url = Uri.parse('$_baseUrl/api/v1/user/rp/linked/$clientId');
final client = createHttpClient(withCredentials: true);
try {
final response = await client.delete(
url,
headers: {'Content-Type': 'application/json'},
);
if (response.statusCode != 200) {
final errorBody = jsonDecode(response.body);
throw Exception(errorBody['error'] ?? '연동 해지에 실패했습니다.');
}
} finally {
client.close();
}
}
static Future<void> sendLog(String level, String message, {Map<String, dynamic>? data}) async {
if (!_canSendClientLog()) {
return;