1
0
forked from baron/baron-sso

이메일/비밀번호 로그인 기능 구현

This commit is contained in:
2026-01-23 15:59:08 +09:00
parent 4c608c6c3c
commit 939d8ee911
4 changed files with 162 additions and 67 deletions

View File

@@ -66,6 +66,26 @@ class AuthProxyService {
}
}
static Future<Map<String, dynamic>> loginWithPassword(String loginId, String password) async {
final url = Uri.parse('$_baseUrl/api/v1/auth/password/login');
final response = await http.post(
url,
headers: {'Content-Type': 'application/json'},
body: jsonEncode({
'loginId': loginId,
'password': password,
}),
);
if (response.statusCode == 200) {
return jsonDecode(response.body);
} else {
final errorBody = jsonDecode(response.body);
throw Exception(errorBody['error'] ?? 'Failed to login');
}
}
static Future<void> sendSms(String phoneNumber) async {
final url = Uri.parse('$_baseUrl/api/v1/auth/sms');