From 3671d94e593597cff6f24e3595c403e11da5f7a6 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Sun, 14 Aug 2022 12:43:13 +0100 Subject: [PATCH] Implement re-checking and resetting authentication status --- app/urls.py | 6 ++ core/lib/manage/threshold.py | 7 ++ .../irc/network/modals/registration.html | 79 +++++++++++++------ core/views/manage/threshold/irc.py | 26 ++++++ 4 files changed, 96 insertions(+), 22 deletions(-) diff --git a/app/urls.py b/app/urls.py index 0cf05b9..2d3ebb3 100644 --- a/app/urls.py +++ b/app/urls.py @@ -30,6 +30,7 @@ from core.views.manage.threshold.irc import ( ThresholdIRCActions, ThresholdIRCActionsAddNetwork, ThresholdIRCActionsRegistration, + ThresholdIRCActionsRegistrationAuth, ThresholdIRCAliases, ThresholdIRCAliasesEdit, ThresholdIRCNetworkActions, @@ -135,6 +136,11 @@ urlpatterns = [ ThresholdIRCActionsAddNetwork.as_view(), name="threshold_irc_actions_add-network", ), + path( + "manage/threshold/irc/actions/registration/auth/", + ThresholdIRCActionsRegistrationAuth.as_view(), + name="threshold_irc_actions_registration_auth", + ), path( "manage/threshold/irc/actions/registration//", ThresholdIRCActionsRegistration.as_view(), diff --git a/core/lib/manage/threshold.py b/core/lib/manage/threshold.py index 5671e95..5f4d2fc 100644 --- a/core/lib/manage/threshold.py +++ b/core/lib/manage/threshold.py @@ -246,3 +246,10 @@ def irc_enable_auth(net, num): payload = {} enabled = threshold_request(url, payload, method="POST") return enabled + + +def irc_check_auth(data): + url = "irc/network/auth" + payload = data + updated = threshold_request(url, payload, method="POST") + return updated diff --git a/core/templates/manage/threshold/irc/network/modals/registration.html b/core/templates/manage/threshold/irc/network/modals/registration.html index d78ce14..ddeade3 100644 --- a/core/templates/manage/threshold/irc/network/modals/registration.html +++ b/core/templates/manage/threshold/irc/network/modals/registration.html @@ -6,31 +6,66 @@