feat: passkey wip

This commit is contained in:
Seefs
2025-09-29 21:54:16 +08:00
parent dcf4336c75
commit 84cdd24116
3 changed files with 25 additions and 25 deletions

View File

@@ -215,13 +215,13 @@ const EditChannelModal = (props) => {
onSuccess: (result) => {
// 验证成功后显示密钥
if (result.success && result.data?.key) {
showSuccess(t('密钥获取成功'));
setKeyDisplayState({
showModal: true,
keyData: result.data.key,
});
}
},
successMessage: t('密钥获取成功'),
});
// 重置密钥显示状态
@@ -607,24 +607,15 @@ const EditChannelModal = (props) => {
// 显示安全验证模态框并开始验证流程
const handleShow2FAModal = async () => {
try {
console.log('=== handleShow2FAModal called ===');
console.log('channelId:', channelId);
console.log('startVerification function:', typeof startVerification);
// 测试模态框状态
console.log('Current modal state:', isModalVisible);
const apiCall = createApiCalls.viewChannelKey(channelId);
console.log('apiCall created:', typeof apiCall);
const result = await startVerification(apiCall, {
await startVerification(apiCall, {
title: t('查看渠道密钥'),
description: t('为了保护账户安全,请验证您的身份。'),
preferredMethod: 'passkey', // 优先使用 Passkey
});
console.log('startVerification result:', result);
} catch (error) {
console.error('handleShow2FAModal error:', error);
console.error('Failed to start verification:', error);
showError(error.message || t('启动验证失败'));
}
};