mirror of
https://github.com/sonr-io/sonr.git
synced 2026-08-02 17:31:39 +00:00
refactor: Update register handler to use protocol.CredentialDescriptor struct
This commit is contained in:
@@ -107,13 +107,9 @@ navigator.credentials
|
|||||||
.then((newCredentialInfo) => {
|
.then((newCredentialInfo) => {
|
||||||
// Convert credential to base64 string
|
// Convert credential to base64 string
|
||||||
const credentialJSON = JSON.stringify({
|
const credentialJSON = JSON.stringify({
|
||||||
id: newCredentialInfo.id,
|
CredentialID: Array.from(new Uint8Array(newCredentialInfo.rawId)),
|
||||||
rawId: Array.from(new Uint8Array(newCredentialInfo.rawId)),
|
Type: newCredentialInfo.type,
|
||||||
response: {
|
Transport: newCredentialInfo.response.getTransports ? newCredentialInfo.response.getTransports() : []
|
||||||
attestationObject: Array.from(new Uint8Array(newCredentialInfo.response.attestationObject)),
|
|
||||||
clientDataJSON: Array.from(new Uint8Array(newCredentialInfo.response.clientDataJSON))
|
|
||||||
},
|
|
||||||
type: newCredentialInfo.type
|
|
||||||
});
|
});
|
||||||
document.getElementById('credential-data').value = btoa(credentialJSON);
|
document.getElementById('credential-data').value = btoa(credentialJSON);
|
||||||
// Show credential details
|
// Show credential details
|
||||||
|
|||||||
Reference in New Issue
Block a user