Skip to content

Commit aedf6f0

Browse files
committed
feat(passkey): 🎨 添加 mediation 为 required
1 parent 01c11e4 commit aedf6f0

File tree

6 files changed

+8
-10
lines changed

6 files changed

+8
-10
lines changed

packages/guard-core-v4/src/MFA/core/passkey.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,6 @@ const VerifyPasskey: React.FC<VerifyPasskeyProps> = props => {
163163
}
164164
}, [])
165165

166-
// 首次进入页面立即开始验证
167-
React.useEffect(() => {
168-
handleVerifyPasskey()
169-
}, [])
170-
171166
return (
172167
<>
173168
<h3 className="authing-g2-mfa-title">{t('common.passkeyVerifyTitle')}</h3>

packages/guard-core-v4/src/_utils/locales/en-us/common.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@
226226
"createNow": "Create now",
227227
"passkeyVerifyTitle": "Passkey verify",
228228
"passkeyVerifyTips": "To ensure access security, please complete verification according to the browser prompts",
229-
"reVerify": "reverify",
229+
"reVerify": "Verify Passkey",
230230
"inviteExpired": "The current invitation link has expired. Please contact the relevant administrator to resend the invitation for you.",
231231
"pageExpired": "The current page has expired. Please click the invitation link again to enter",
232232
"inviteSuccess": "Successfully joined, please check your email. Please complete the login based on the information in the email.",

packages/guard-core-v4/src/_utils/locales/ja-jp/common.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@
226226
"createNow": "今すぐ作成",
227227
"passkeyVerifyTitle": "パスキーログイン",
228228
"passkeyVerifyTips": "アクセスのセキュリティを確保するため、ブラウザのプロンプトに従って検証を完了してください",
229-
"reVerify": "再検証",
229+
"reVerify": "検証 Passkey",
230230
"inviteExpired": "現在の招待リンクは無効です。関連管理者に連絡して招待を再開してください。",
231231
"pageExpired": "現在のページは期限切れですので、招待リンクをもう一度クリックしてください",
232232
"inviteSuccess": "正常に参加しました。メールを確認してください。メール内の情報に基づいてログインを完了してください。",

packages/guard-core-v4/src/_utils/locales/zh-cn/common.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@
226226
"createNow": "立即创建",
227227
"passkeyVerifyTitle": "Passkey 验证",
228228
"passkeyVerifyTips": "为了保障访问安全,请根据浏览器提示完成验证",
229-
"reVerify": "重新验证",
229+
"reVerify": "验证 Passkey",
230230
"inviteExpired": "当前邀请链接已失效,请联系相关管理员为你重新发起邀请。",
231231
"pageExpired": "当前页面已过期,请重新点击邀请链接进入",
232232
"inviteSuccess": "已成功加入,敬请查收邮件。请根据邮件内的信息完成登录。",

packages/guard-core-v4/src/_utils/locales/zh-tw/common.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@
224224
"createNow": "立即建立",
225225
"passkeyVerifyTitle": "Passkey 驗證",
226226
"passkeyVerifyTips": "為了保障存取安全,請根據瀏覽器提示完成驗證",
227-
"reVerify": "重新驗證",
227+
"reVerify": "驗證 Passkey",
228228
"inviteExpired": "當前邀請連結已失效,請聯系相關管理員為你重新發起邀請。",
229229
"pageExpired": "當前頁面已過期,請重新點擊邀請連結進入",
230230
"inviteSuccess": "已成功加入,敬請查收郵件。 請根據郵件內的資訊完成登入。",

packages/guard-core-v4/src/_utils/passkey.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ export const verifyPasskey = async (
2020
challenge: CredentialRequestOptionsJSON
2121
) => {
2222
try {
23-
const attestation = await getWebauthnCredential(challenge)
23+
const attestation = await getWebauthnCredential({
24+
mediation: 'required',
25+
...challenge
26+
})
2427
return attestation
2528
} catch (error) {
2629
console.warn('browser verify passkey error: ', error)

0 commit comments

Comments
 (0)