mirror of
https://github.com/simple-login/app.git
synced 2024-11-18 14:43:32 +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("=")
|
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 = []
|
webauthn_users = []
|
||||||
for record in fido_model:
|
for fido in fidos:
|
||||||
webauthn_users.append(
|
webauthn_users.append(
|
||||||
webauthn.WebAuthnUser(
|
webauthn.WebAuthnUser(
|
||||||
user.fido_uuid,
|
user.fido_uuid,
|
||||||
user.email,
|
user.email,
|
||||||
user.name if user.name else user.email,
|
user.name if user.name else user.email,
|
||||||
False,
|
False,
|
||||||
record.credential_id,
|
fido.credential_id,
|
||||||
record.public_key,
|
fido.public_key,
|
||||||
record.sign_count,
|
fido.sign_count,
|
||||||
RP_ID,
|
RP_ID,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
|
@ -34,9 +34,9 @@ def fido_setup():
|
||||||
return redirect(url_for("dashboard.index"))
|
return redirect(url_for("dashboard.index"))
|
||||||
|
|
||||||
if current_user.fido_uuid is not None:
|
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:
|
else:
|
||||||
fido_model = []
|
fidos = []
|
||||||
|
|
||||||
fido_token_form = FidoTokenForm()
|
fido_token_form = FidoTokenForm()
|
||||||
|
|
||||||
|
@ -113,11 +113,11 @@ def fido_setup():
|
||||||
del registration_dict["extensions"]["webauthn.loc"]
|
del registration_dict["extensions"]["webauthn.loc"]
|
||||||
|
|
||||||
# Prevent user from adding duplicated keys
|
# Prevent user from adding duplicated keys
|
||||||
for record in fido_model:
|
for fido in fidos:
|
||||||
registration_dict["excludeCredentials"].append(
|
registration_dict["excludeCredentials"].append(
|
||||||
{
|
{
|
||||||
"type": "public-key",
|
"type": "public-key",
|
||||||
"id": record.credential_id,
|
"id": fido.credential_id,
|
||||||
"transports": ["usb", "nfc", "ble", "internal"],
|
"transports": ["usb", "nfc", "ble", "internal"],
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue