fido_model -> fidos

This commit is contained in:
devStorm 2020-05-18 13:55:38 -07:00
parent ea914e0378
commit 7bd97e13b0
No known key found for this signature in database
GPG key ID: D52E1B66F336AC57
2 changed files with 9 additions and 9 deletions

View file

@ -94,18 +94,18 @@ def fido():
session["fido_challenge"] = challenge.rstrip("=")
fido_model = Fido.filter_by(uuid=user.fido_uuid).all()
fidos = Fido.filter_by(uuid=user.fido_uuid).all()
webauthn_users = []
for record in fido_model:
for fido in fidos:
webauthn_users.append(
webauthn.WebAuthnUser(
user.fido_uuid,
user.email,
user.name if user.name else user.email,
False,
record.credential_id,
record.public_key,
record.sign_count,
fido.credential_id,
fido.public_key,
fido.sign_count,
RP_ID,
)
)

View file

@ -34,9 +34,9 @@ def fido_setup():
return redirect(url_for("dashboard.index"))
if current_user.fido_uuid is not None:
fido_model = Fido.filter_by(uuid=current_user.fido_uuid).all()
fidos = Fido.filter_by(uuid=current_user.fido_uuid).all()
else:
fido_model = []
fidos = []
fido_token_form = FidoTokenForm()
@ -113,11 +113,11 @@ def fido_setup():
del registration_dict["extensions"]["webauthn.loc"]
# Prevent user from adding duplicated keys
for record in fido_model:
for fido in fidos:
registration_dict["excludeCredentials"].append(
{
"type": "public-key",
"id": record.credential_id,
"id": fido.credential_id,
"transports": ["usb", "nfc", "ble", "internal"],
}
)