mirror of
https://github.com/simple-login/app.git
synced 2024-09-27 20:31:30 +02:00
Calculate RP_ID in config
This commit is contained in:
parent
c38b3c768c
commit
282cbe25a3
@ -1,8 +1,7 @@
|
||||
import json
|
||||
import secrets
|
||||
import webauthn
|
||||
from app.config import URL as SITE_URL
|
||||
from urllib.parse import urlparse
|
||||
from app.config import RP_ID
|
||||
|
||||
from flask import request, render_template, redirect, url_for, flash, session
|
||||
from flask_login import login_user
|
||||
@ -40,8 +39,6 @@ def fido():
|
||||
|
||||
next_url = request.args.get("next")
|
||||
|
||||
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)
|
||||
|
@ -4,6 +4,7 @@ import string
|
||||
import subprocess
|
||||
|
||||
from dotenv import load_dotenv
|
||||
from urllib.parse import urlparse
|
||||
|
||||
SHA1 = subprocess.getoutput("git rev-parse HEAD")
|
||||
ROOT_DIR = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
||||
@ -38,6 +39,9 @@ DEBUG = os.environ["DEBUG"] if "DEBUG" in os.environ else False
|
||||
URL = os.environ["URL"]
|
||||
print(">>> URL:", URL)
|
||||
|
||||
# Calculate RP_ID for WebAuthn
|
||||
RP_ID = urlparse(URL).hostname
|
||||
|
||||
SENTRY_DSN = os.environ.get("SENTRY_DSN")
|
||||
|
||||
# can use another sentry project for the front-end to avoid noises
|
||||
|
@ -2,7 +2,7 @@ import uuid
|
||||
import json
|
||||
import secrets
|
||||
import webauthn
|
||||
from app.config import URL as SITE_URL
|
||||
from app.config import RP_ID
|
||||
from urllib.parse import urlparse
|
||||
|
||||
from flask import render_template, flash, redirect, url_for, session
|
||||
@ -28,8 +28,6 @@ def fido_setup():
|
||||
|
||||
fido_token_form = FidoTokenForm()
|
||||
|
||||
RP_ID = urlparse(SITE_URL).hostname
|
||||
|
||||
# Handling POST requests
|
||||
if fido_token_form.validate_on_submit():
|
||||
try:
|
||||
|
Loading…
Reference in New Issue
Block a user