Browse Source

Remove a verify_origin workaround

pull/456/head
Pēteris Caune 4 years ago
parent
commit
ecf964ea3b
No known key found for this signature in database GPG Key ID: E28D7679E9A9EDE2
1 changed files with 2 additions and 8 deletions
  1. +2
    -8
      hc/accounts/views.py

+ 2
- 8
hc/accounts/views.py View File

@ -574,16 +574,11 @@ def remove_project(request, code):
return redirect("hc-index") return redirect("hc-index")
def _verify_origin(aaa):
return lambda o: True
@login_required @login_required
@require_sudo_mode @require_sudo_mode
def add_credential(request): def add_credential(request):
rp = PublicKeyCredentialRpEntity("localhost", "Healthchecks") rp = PublicKeyCredentialRpEntity("localhost", "Healthchecks")
# FIXME use HTTPS, remove the verify_origin hack
server = Fido2Server(rp, verify_origin=_verify_origin)
server = Fido2Server(rp)
if request.method == "POST": if request.method == "POST":
form = forms.AddCredentialForm(request.POST) form = forms.AddCredentialForm(request.POST)
@ -639,8 +634,7 @@ def remove_credential(request, code):
def login_tfa(request): def login_tfa(request):
rp = PublicKeyCredentialRpEntity("localhost", "Healthchecks") rp = PublicKeyCredentialRpEntity("localhost", "Healthchecks")
# FIXME use HTTPS, remove the verify_origin hack
server = Fido2Server(rp, verify_origin=_verify_origin)
server = Fido2Server(rp)
if "2fa_user_id" not in request.session: if "2fa_user_id" not in request.session:
return HttpResponseBadRequest() return HttpResponseBadRequest()


Loading…
Cancel
Save