mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-08-12 00:19:48 +00:00
Feature: two-factor authentication (#8012)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import os
|
||||
|
||||
from allauth.account import views as allauth_account_views
|
||||
from allauth.mfa.base import views as allauth_mfa_views
|
||||
from allauth.socialaccount import views as allauth_social_account_views
|
||||
from allauth.urls import build_provider_urlpatterns
|
||||
from django.conf import settings
|
||||
@@ -54,6 +55,7 @@ from paperless.views import GenerateAuthTokenView
|
||||
from paperless.views import GroupViewSet
|
||||
from paperless.views import ProfileView
|
||||
from paperless.views import SocialAccountProvidersView
|
||||
from paperless.views import TOTPView
|
||||
from paperless.views import UserViewSet
|
||||
from paperless_mail.views import MailAccountTestView
|
||||
from paperless_mail.views import MailAccountViewSet
|
||||
@@ -146,19 +148,34 @@ urlpatterns = [
|
||||
BulkEditObjectsView.as_view(),
|
||||
name="bulk_edit_objects",
|
||||
),
|
||||
path("profile/generate_auth_token/", GenerateAuthTokenView.as_view()),
|
||||
path(
|
||||
"profile/disconnect_social_account/",
|
||||
DisconnectSocialAccountView.as_view(),
|
||||
),
|
||||
path(
|
||||
"profile/social_account_providers/",
|
||||
SocialAccountProvidersView.as_view(),
|
||||
),
|
||||
re_path(
|
||||
"^profile/",
|
||||
ProfileView.as_view(),
|
||||
name="profile_view",
|
||||
include(
|
||||
[
|
||||
path(
|
||||
"generate_auth_token/",
|
||||
GenerateAuthTokenView.as_view(),
|
||||
),
|
||||
path(
|
||||
"disconnect_social_account/",
|
||||
DisconnectSocialAccountView.as_view(),
|
||||
),
|
||||
path(
|
||||
"social_account_providers/",
|
||||
SocialAccountProvidersView.as_view(),
|
||||
),
|
||||
re_path(
|
||||
"^$",
|
||||
ProfileView.as_view(),
|
||||
name="profile_view",
|
||||
),
|
||||
path(
|
||||
"totp/",
|
||||
TOTPView.as_view(),
|
||||
name="totp_view",
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
re_path(
|
||||
"^status/",
|
||||
@@ -296,6 +313,12 @@ urlpatterns = [
|
||||
),
|
||||
),
|
||||
*build_provider_urlpatterns(),
|
||||
# mfa, see allauth/mfa/base/urls.py
|
||||
path(
|
||||
"2fa/authenticate/",
|
||||
allauth_mfa_views.authenticate,
|
||||
name="mfa_authenticate",
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
Reference in New Issue
Block a user