Merge pull request #21953 from nextcloud/backport/21946/stable19

[stable19] Do not double encode the userid in webauthn login
This commit is contained in:
Roeland Jago Douma 2020-07-23 09:30:19 +02:00 committed by GitHub
commit fcc708ff22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 3 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -155,6 +155,10 @@ export default {
return window.btoa(String.fromCharCode(...a))
}
const arrayToString = function(a) {
return String.fromCharCode(...a)
}
return navigator.credentials.get({ publicKey })
.then(data => {
console.debug(data)
@ -168,7 +172,7 @@ export default {
authenticatorData: arrayToBase64String(new Uint8Array(data.response.authenticatorData)),
clientDataJSON: arrayToBase64String(new Uint8Array(data.response.clientDataJSON)),
signature: arrayToBase64String(new Uint8Array(data.response.signature)),
userHandle: data.response.userHandle ? arrayToBase64String(new Uint8Array(data.response.userHandle)) : null,
userHandle: data.response.userHandle ? arrayToString(new Uint8Array(data.response.userHandle)) : null,
},
}
})