| 1 |
from django.urls import URLPattern, URLResolver, include, path |
| 2 |
|
| 3 |
from allauth.mfa import app_settings |
| 4 |
from allauth.mfa.webauthn import views |
| 5 |
|
| 6 |
|
| 7 |
urlpatterns: list[URLPattern | URLResolver] = [ |
| 8 |
path("", views.list_webauthn, name="mfa_list_webauthn"), |
| 9 |
path("add/", views.add_webauthn, name="mfa_add_webauthn"), |
| 10 |
path( |
| 11 |
"reauthenticate/", |
| 12 |
views.reauthenticate_webauthn, |
| 13 |
name="mfa_reauthenticate_webauthn", |
| 14 |
), |
| 15 |
path( |
| 16 |
"keys/<int:pk>/", |
| 17 |
include( |
| 18 |
[ |
| 19 |
path( |
| 20 |
"remove/", |
| 21 |
views.remove_webauthn, |
| 22 |
name="mfa_remove_webauthn", |
| 23 |
), |
| 24 |
path( |
| 25 |
"edit/", |
| 26 |
views.edit_webauthn, |
| 27 |
name="mfa_edit_webauthn", |
| 28 |
), |
| 29 |
] |
| 30 |
), |
| 31 |
), |
| 32 |
] |
| 33 |
|
| 34 |
if app_settings.PASSKEY_LOGIN_ENABLED: |
| 35 |
urlpatterns.append(path("login/", views.login_webauthn, name="mfa_login_webauthn")) |
| 36 |
if app_settings.PASSKEY_SIGNUP_ENABLED: |
| 37 |
urlpatterns.append( |
| 38 |
path("signup/", views.signup_webauthn, name="mfa_signup_webauthn") |
| 39 |
) |