1
0
forked from baron/baron-sso

활동상황 카드 '연동 해지' 액션 추가

This commit is contained in:
2026-02-04 09:57:51 +09:00
parent 0eda7bde13
commit 1f1e7b6ce7

View File

@@ -3,6 +3,7 @@ import 'package:http/http.dart' as http;
import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'http_client.dart';
import 'web_window.dart';
import 'auth_token_store.dart';
class AuthProxyService {
static String _envOrDefault(String key, String fallback) {
@@ -596,11 +597,21 @@ class AuthProxyService {
static Future<List<dynamic>> fetchLinkedRps() async {
final url = Uri.parse('$_baseUrl/api/v1/user/rp/linked');
final client = createHttpClient(withCredentials: true);
final useCookie = AuthTokenStore.usesCookie();
final token = AuthTokenStore.getToken();
final client = createHttpClient(withCredentials: useCookie);
final headers = <String, String>{
'Content-Type': 'application/json',
};
if (!useCookie && token != null) {
headers['Authorization'] = 'Bearer $token';
}
try {
final response = await client.get(
url,
headers: {'Content-Type': 'application/json'},
headers: headers,
);
if (response.statusCode == 200) {
@@ -616,11 +627,21 @@ class AuthProxyService {
static Future<void> revokeLinkedRp(String clientId) async {
final url = Uri.parse('$_baseUrl/api/v1/user/rp/linked/$clientId');
final client = createHttpClient(withCredentials: true);
final useCookie = AuthTokenStore.usesCookie();
final token = AuthTokenStore.getToken();
final client = createHttpClient(withCredentials: useCookie);
final headers = <String, String>{
'Content-Type': 'application/json',
};
if (!useCookie && token != null) {
headers['Authorization'] = 'Bearer $token';
}
try {
final response = await client.delete(
url,
headers: {'Content-Type': 'application/json'},
headers: headers,
);
if (response.statusCode != 200) {