From 6412519b537e211df039bdaabb23af362db54b10 Mon Sep 17 00:00:00 2001 From: MaysWind Date: Sun, 22 Nov 2020 12:18:18 +0800 Subject: [PATCH] modify webauthn config --- src/lib/webauthn.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/webauthn.js b/src/lib/webauthn.js index e493e60b..23e2f893 100644 --- a/src/lib/webauthn.js +++ b/src/lib/webauthn.js @@ -47,7 +47,7 @@ function isCompletelySupported() { } function registerCredential({ username, nickname }, userSecret) { - if (!window.location || !window.location.hostname || !document.title) { + if (!window.location || !window.location.hostname) { return Promise.reject({ notSupported: true }); @@ -63,13 +63,13 @@ function registerCredential({ username, nickname }, userSecret) { const publicKeyCredentialCreationOptions = Object.assign({}, PUBLIC_KEY_CREDENTIAL_CREATION_OPTIONS_TEMPLATE, { challenge: Uint8Array.from(challenge, c => c.charCodeAt(0)), rp: { - name: document.title, - id: window.location.hostname, + name: window.location.hostname, + id: window.location.hostname }, user: { id: Uint8Array.from(userSecret, c => c.charCodeAt(0)), name: username, - displayName: nickname, + displayName: nickname } });