forked from baron/baron-sso
SMS 인증 코드 발송 및 검증 UI/로직 연동
This commit is contained in:
@@ -74,6 +74,25 @@ class AuthProxyService {
|
||||
}
|
||||
}
|
||||
|
||||
static Future<Map<String, dynamic>> verifySmsCode(String phoneNumber, String code) async {
|
||||
final url = Uri.parse('$_baseUrl/api/v1/auth/verify-sms');
|
||||
|
||||
final response = await http.post(
|
||||
url,
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
body: jsonEncode({
|
||||
'phoneNumber': phoneNumber,
|
||||
'code': code,
|
||||
}),
|
||||
);
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
return jsonDecode(response.body);
|
||||
} else {
|
||||
throw Exception('Failed to verify code: ${response.body}');
|
||||
}
|
||||
}
|
||||
|
||||
static Future<void> logError(String message) async {
|
||||
final url = Uri.parse('$_baseUrl/api/v1/client-log');
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user