2011-04-30 05:18:32 +00:00
|
|
|
"""
|
|
|
|
URL patterns for the views included in ``django.contrib.auth``.
|
|
|
|
|
|
|
|
Including these URLs (via the ``include()`` directive) will set up the
|
|
|
|
following patterns based at whatever URL prefix they are included
|
|
|
|
under:
|
|
|
|
|
|
|
|
* User login at ``login/``.
|
|
|
|
|
|
|
|
* User logout at ``logout/``.
|
|
|
|
|
|
|
|
* The two-step password change at ``password/change/`` and
|
|
|
|
``password/change/done/``.
|
|
|
|
|
|
|
|
* The four-step password reset at ``password/reset/``,
|
|
|
|
``password/reset/confirm/``, ``password/reset/complete/`` and
|
|
|
|
``password/reset/done/``.
|
|
|
|
|
|
|
|
The default registration backend already has an ``include()`` for
|
|
|
|
these URLs, so under the default setup it is not necessary to manually
|
|
|
|
include these views. Other backends may or may not include them;
|
|
|
|
consult a specific backend's documentation for details.
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
2014-01-02 10:26:23 +00:00
|
|
|
from django.conf import settings
|
2023-06-12 01:53:31 +00:00
|
|
|
from django.urls import path, re_path
|
2011-04-30 05:18:32 +00:00
|
|
|
|
2013-05-07 02:33:26 +00:00
|
|
|
from seahub.auth import views as auth_views
|
2017-08-23 06:43:32 +00:00
|
|
|
from seahub.two_factor.views.login import TwoFactorVerifyView
|
2011-04-30 05:18:32 +00:00
|
|
|
|
2018-02-06 09:36:04 +00:00
|
|
|
urlpatterns = [
|
2023-06-12 01:53:31 +00:00
|
|
|
path('password/change/',
|
2018-02-06 09:36:04 +00:00
|
|
|
auth_views.password_change,
|
|
|
|
name='auth_password_change'),
|
2023-06-12 01:53:31 +00:00
|
|
|
path('password/change/done/',
|
2018-02-06 09:36:04 +00:00
|
|
|
auth_views.password_change_done,
|
|
|
|
name='auth_password_change_done'),
|
2023-06-12 01:53:31 +00:00
|
|
|
path('password/reset/',
|
2018-02-06 09:36:04 +00:00
|
|
|
auth_views.password_reset,
|
|
|
|
name='auth_password_reset'),
|
2023-06-12 01:53:31 +00:00
|
|
|
re_path(r'^password/reset/confirm/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/$',
|
2018-02-06 09:36:04 +00:00
|
|
|
auth_views.password_reset_confirm,
|
|
|
|
name='auth_password_reset_confirm'),
|
2023-06-12 01:53:31 +00:00
|
|
|
path('password/reset/complete/',
|
2018-02-06 09:36:04 +00:00
|
|
|
auth_views.password_reset_complete,
|
|
|
|
name='auth_password_reset_complete'),
|
2023-06-12 01:53:31 +00:00
|
|
|
path('password/reset/done/',
|
2018-02-06 09:36:04 +00:00
|
|
|
auth_views.password_reset_done,
|
|
|
|
name='auth_password_reset_done'),
|
2017-08-23 06:43:32 +00:00
|
|
|
|
2023-06-12 01:53:31 +00:00
|
|
|
path('login/two-factor-auth/',
|
2018-02-06 09:36:04 +00:00
|
|
|
TwoFactorVerifyView.as_view(),
|
|
|
|
name='two_factor_auth'),
|
|
|
|
]
|
2014-01-02 10:26:23 +00:00
|
|
|
|
2018-04-11 04:04:22 +00:00
|
|
|
urlpatterns += [
|
2023-06-12 01:53:31 +00:00
|
|
|
path('login/',
|
2018-04-11 04:04:22 +00:00
|
|
|
auth_views.login,
|
|
|
|
{'template_name': 'registration/login.html',
|
|
|
|
'redirect_if_logged_in': 'libraries'},
|
|
|
|
name='auth_login'),
|
2023-06-12 01:53:31 +00:00
|
|
|
path('logout/',
|
2018-04-11 04:04:22 +00:00
|
|
|
auth_views.logout,
|
|
|
|
{'template_name': 'registration/logout.html',
|
|
|
|
'next_page': settings.LOGOUT_REDIRECT_URL},
|
|
|
|
name='auth_logout'),
|
|
|
|
]
|