DRY attested webauthn creds data

This commit is contained in:
Leo Hemsted
2021-06-01 18:29:02 +01:00
parent e864100be7
commit 0ec92e8c2f
2 changed files with 10 additions and 12 deletions

View File

@@ -353,6 +353,13 @@ class User(JSONModel, UserMixin):
return [WebAuthnCredential(json) for json in
user_api_client.get_webauthn_credentials_for_user(self.id)]
@property
def webauthn_credentials_as_cbor(self):
return [
credential.to_credential_data()
for credential in self.webauthn_credentials
]
def serialize(self):
dct = {
"id": self.id,