mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-20 17:54:30 +08:00
modify webauthn config
This commit is contained in:
+4
-4
@@ -47,7 +47,7 @@ function isCompletelySupported() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function registerCredential({ username, nickname }, userSecret) {
|
function registerCredential({ username, nickname }, userSecret) {
|
||||||
if (!window.location || !window.location.hostname || !document.title) {
|
if (!window.location || !window.location.hostname) {
|
||||||
return Promise.reject({
|
return Promise.reject({
|
||||||
notSupported: true
|
notSupported: true
|
||||||
});
|
});
|
||||||
@@ -63,13 +63,13 @@ function registerCredential({ username, nickname }, userSecret) {
|
|||||||
const publicKeyCredentialCreationOptions = Object.assign({}, PUBLIC_KEY_CREDENTIAL_CREATION_OPTIONS_TEMPLATE, {
|
const publicKeyCredentialCreationOptions = Object.assign({}, PUBLIC_KEY_CREDENTIAL_CREATION_OPTIONS_TEMPLATE, {
|
||||||
challenge: Uint8Array.from(challenge, c => c.charCodeAt(0)),
|
challenge: Uint8Array.from(challenge, c => c.charCodeAt(0)),
|
||||||
rp: {
|
rp: {
|
||||||
name: document.title,
|
name: window.location.hostname,
|
||||||
id: window.location.hostname,
|
id: window.location.hostname
|
||||||
},
|
},
|
||||||
user: {
|
user: {
|
||||||
id: Uint8Array.from(userSecret, c => c.charCodeAt(0)),
|
id: Uint8Array.from(userSecret, c => c.charCodeAt(0)),
|
||||||
name: username,
|
name: username,
|
||||||
displayName: nickname,
|
displayName: nickname
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user