1
0
forked from baron/baron-sso

SMS 인증 코드 발송 및 검증 UI/로직 연동

This commit is contained in:
2026-01-06 16:33:21 +09:00
parent 659ccfbe53
commit c4b86f77f1
2 changed files with 37 additions and 2 deletions

View File

@@ -235,19 +235,35 @@ class _LoginScreenState extends ConsumerState<LoginScreen>
final phone = _phoneController.text.trim();
if (phone.isEmpty) return;
print("[Frontend] SMS 코드 발송 시작. 번호: $phone");
try {
await AuthProxyService.sendSms(phone);
print("[Frontend] SMS 코드 발송 요청 성공.");
setState(() {
_smsSent = true;
});
} catch (e) {
print("[Frontend] SMS 코드 발송 요청 실패: $e");
_showError("Failed to send SMS: $e");
}
}
Future<void> _handleSmsVerification() async {
// For now, just show a success message
_showSuccessDialog();
final phone = _phoneController.text.trim();
final code = _smsCodeController.text.trim();
if (phone.isEmpty || code.isEmpty) return;
print("[Frontend] SMS 코드 검증 시작. 번호: $phone, 코드: $code");
try {
final result = await AuthProxyService.verifySmsCode(phone, code);
final token = result['token'];
print("[Frontend] SMS 코드 검증 성공. JWT 수신: $token");
// TODO: Handle the JWT token from the result, e.g., result['token']
_showSuccessDialog();
} catch (e) {
print("[Frontend] SMS 코드 검증 실패: $e");
_showError("Failed to verify code: $e");
}
}
void _showError(String message) {