Make RP_ID a constant

This commit is contained in:
devStorm 2020-05-07 02:33:24 -07:00
parent b8b1313db9
commit 3ab3f819b7
No known key found for this signature in database
GPG Key ID: D52E1B66F336AC57
2 changed files with 5 additions and 5 deletions

View File

@ -40,11 +40,11 @@ def fido():
next_url = request.args.get("next")
rp_id = urlparse(SITE_URL).hostname
RP_ID = urlparse(SITE_URL).hostname
webauthn_user = webauthn.WebAuthnUser(
user.fido_uuid, user.email, user.name, False,
user.fido_credential_id, user.fido_pk, user.fido_sign_count, rp_id)
user.fido_credential_id, user.fido_pk, user.fido_sign_count, RP_ID)
# Handling POST requests
if fido_token_form.validate_on_submit():

View File

@ -28,7 +28,7 @@ def fido_setup():
fido_token_form = FidoTokenForm()
rp_id = urlparse(SITE_URL).hostname
RP_ID = urlparse(SITE_URL).hostname
# Handling POST requests
if fido_token_form.validate_on_submit():
@ -42,7 +42,7 @@ def fido_setup():
challenge = session['fido_challenge']
fido_reg_response = webauthn.WebAuthnRegistrationResponse(
rp_id,
RP_ID,
SITE_URL,
sk_assertion,
challenge,
@ -70,7 +70,7 @@ def fido_setup():
challenge = secrets.token_urlsafe(32)
credential_create_options = webauthn.WebAuthnMakeCredentialOptions(
challenge, 'Simple Login', rp_id, fido_uuid,
challenge, 'Simple Login', RP_ID, fido_uuid,
current_user.email, current_user.name, False, attestation='none')
# Don't think this one should be used, but it's not configurable by arguments