use simplified URL routing syntax
was introduced in django 2.0
This commit is contained in:
@@ -14,15 +14,15 @@ Including another URLconf
|
|||||||
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
||||||
"""
|
"""
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
from django.urls import include, path, re_path
|
from django.urls import include, path
|
||||||
|
|
||||||
from . import auth, views
|
from . import auth, views
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path("admin/", admin.site.urls),
|
path("admin/", admin.site.urls),
|
||||||
path("mfa/", include("mfa.urls")),
|
path("mfa/", include("mfa.urls")),
|
||||||
path("auth/login", auth.loginView, name="login"),
|
path("auth/login/", auth.loginView, name="login"),
|
||||||
path("auth/logout", auth.logoutView, name="logout"),
|
path("auth/logout/", auth.logoutView, name="logout"),
|
||||||
re_path("^$", views.home, name="home"),
|
path("", views.home, name="home"),
|
||||||
path("registered/", views.registered, name="registered"),
|
path("registered/", views.registered, name="registered"),
|
||||||
]
|
]
|
||||||
|
|||||||
73
mfa/urls.py
73
mfa/urls.py
@@ -1,44 +1,41 @@
|
|||||||
try:
|
from django.urls import path
|
||||||
from django.urls import re_path as url
|
|
||||||
except:
|
|
||||||
from django.conf.urls import url
|
|
||||||
|
|
||||||
from . import FIDO2, U2F, Email, TrustedDevice, helpers, totp, views
|
from . import FIDO2, U2F, Email, TrustedDevice, helpers, totp, views
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
url(r"totp/start/", totp.start, name="start_new_otop"),
|
path("totp/start/", totp.start, name="start_new_otop"),
|
||||||
url(r"totp/getToken", totp.getToken, name="get_new_otop"),
|
path("totp/getToken/", totp.getToken, name="get_new_otop"),
|
||||||
url(r"totp/verify", totp.verify, name="verify_otop"),
|
path("totp/verify/", totp.verify, name="verify_otop"),
|
||||||
url(r"totp/auth", totp.auth, name="totp_auth"),
|
path("totp/auth/", totp.auth, name="totp_auth"),
|
||||||
url(r"totp/recheck", totp.recheck, name="totp_recheck"),
|
path("totp/recheck/", totp.recheck, name="totp_recheck"),
|
||||||
url(r"email/start/", Email.start, name="start_email"),
|
path("email/start/", Email.start, name="start_email"),
|
||||||
url(r"email/auth/", Email.auth, name="email_auth"),
|
path("email/auth/", Email.auth, name="email_auth"),
|
||||||
url(r"u2f/$", U2F.start, name="start_u2f"),
|
path("u2f/", U2F.start, name="start_u2f"),
|
||||||
url(r"u2f/bind", U2F.bind, name="bind_u2f"),
|
path("u2f/bind/", U2F.bind, name="bind_u2f"),
|
||||||
url(r"u2f/auth", U2F.auth, name="u2f_auth"),
|
path("u2f/auth/", U2F.auth, name="u2f_auth"),
|
||||||
url(r"u2f/process_recheck", U2F.process_recheck, name="u2f_recheck"),
|
path("u2f/process_recheck/", U2F.process_recheck, name="u2f_recheck"),
|
||||||
url(r"u2f/verify", U2F.verify, name="u2f_verify"),
|
path("u2f/verify/", U2F.verify, name="u2f_verify"),
|
||||||
url(r"fido2/$", FIDO2.start, name="start_fido2"),
|
path("fido2/", FIDO2.start, name="start_fido2"),
|
||||||
url(r"fido2/auth", FIDO2.auth, name="fido2_auth"),
|
path("fido2/auth/", FIDO2.auth, name="fido2_auth"),
|
||||||
url(r"fido2/begin_auth", FIDO2.authenticate_begin, name="fido2_begin_auth"),
|
path("fido2/begin_auth/", FIDO2.authenticate_begin, name="fido2_begin_auth"),
|
||||||
url(
|
path(
|
||||||
r"fido2/complete_auth", FIDO2.authenticate_complete, name="fido2_complete_auth"
|
"fido2/complete_auth/", FIDO2.authenticate_complete, name="fido2_complete_auth"
|
||||||
),
|
),
|
||||||
url(r"fido2/begin_reg", FIDO2.begin_registeration, name="fido2_begin_reg"),
|
path("fido2/begin_reg/", FIDO2.begin_registeration, name="fido2_begin_reg"),
|
||||||
url(r"fido2/complete_reg", FIDO2.complete_reg, name="fido2_complete_reg"),
|
path("fido2/complete_reg/", FIDO2.complete_reg, name="fido2_complete_reg"),
|
||||||
url(r"fido2/recheck", FIDO2.recheck, name="fido2_recheck"),
|
path("fido2/recheck/", FIDO2.recheck, name="fido2_recheck"),
|
||||||
url(r"td/$", TrustedDevice.start, name="start_td"),
|
path("td/", TrustedDevice.start, name="start_td"),
|
||||||
url(r"td/add", TrustedDevice.add, name="add_td"),
|
path("td/add/", TrustedDevice.add, name="add_td"),
|
||||||
url(r"td/send_link", TrustedDevice.send_email, name="td_sendemail"),
|
path("td/send_link/", TrustedDevice.send_email, name="td_sendemail"),
|
||||||
url(r"td/get-ua", TrustedDevice.getUserAgent, name="td_get_useragent"),
|
path("td/get-ua/", TrustedDevice.getUserAgent, name="td_get_useragent"),
|
||||||
url(r"td/trust", TrustedDevice.trust_device, name="td_trust_device"),
|
path("td/trust/", TrustedDevice.trust_device, name="td_trust_device"),
|
||||||
url(r"u2f/checkTrusted", TrustedDevice.checkTrusted, name="td_checkTrusted"),
|
path("u2f/checkTrusted/", TrustedDevice.checkTrusted, name="td_checkTrusted"),
|
||||||
url(r"u2f/secure_device", TrustedDevice.getCookie, name="td_securedevice"),
|
path("u2f/secure_device", TrustedDevice.getCookie, name="td_securedevice"),
|
||||||
url(r"^$", views.index, name="mfa_home"),
|
path("", views.index, name="mfa_home"),
|
||||||
url(r"goto/(.*)", views.goto, name="mfa_goto"),
|
path("goto/<method>/", views.goto, name="mfa_goto"),
|
||||||
url(r"selct_method", views.show_methods, name="mfa_methods_list"),
|
path("selct_method/", views.show_methods, name="mfa_methods_list"),
|
||||||
url(r"recheck", helpers.recheck, name="mfa_recheck"),
|
path("recheck/", helpers.recheck, name="mfa_recheck"),
|
||||||
url(r"toggleKey", views.toggleKey, name="toggle_key"),
|
path("toggleKey/", views.toggleKey, name="toggle_key"),
|
||||||
url(r"delete", views.delKey, name="mfa_delKey"),
|
path("delete/", views.delKey, name="mfa_delKey"),
|
||||||
url(r"reset", views.reset_cookie, name="mfa_reset_cookie"),
|
path("reset/", views.reset_cookie, name="mfa_reset_cookie"),
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user