mirror of
https://github.com/simple-login/app.git
synced 2024-11-18 06:31:27 +08:00
fido_model -> fidos
This commit is contained in:
parent
ea914e0378
commit
7bd97e13b0
2 changed files with 9 additions and 9 deletions
|
@ -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,
|
||||
)
|
||||
)
|
||||
|
|
|
@ -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"],
|
||||
}
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue