Skip to content

Commit

Permalink
django path migration
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Leinfelder committed Oct 1, 2022
1 parent 1e4237e commit b392797
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions janus/urls.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""janus URL Configuration
"""
from django.conf.urls import url, include
from django.conf.urls import include
from django.urls import path, re_path
from django.utils.module_loading import import_string
from oauth2_provider.views import TokenView, RevokeTokenView, IntrospectTokenView

Expand All @@ -15,18 +14,20 @@

urlpatterns = [
# use custom view, to enforce the user authenticate permissions
url(r'^o/authorize/?$', AuthorizationView.as_view(), name="authorize"),
re_path(r'^o/authorize/?$', AuthorizationView.as_view(), name="authorize"),

url(r'^o/token/?$', TokenView.as_view(), name="token"),
url(r'^o/revoke_token/?$', RevokeTokenView.as_view(), name="revoke-token"),
url(r"^introspect/?$", IntrospectTokenView.as_view(), name="introspect"),
# default oauth2_provider.url.base_urlpatterns
re_path(r'^o/token/?$', TokenView.as_view(), name="token"),
re_path(r'^o/revoke_token/?$', RevokeTokenView.as_view(), name="revoke-token"),
re_path(r"^introspect/?$", IntrospectTokenView.as_view(), name="introspect"),

url(r'^o/profile/?$', ProfileViewClass.as_view(), name="profile"),
url(r'^o/logout/?$', views.LogoutView.as_view(), name="remote_logout"),
url(r'^o/not_authorized/$', views.not_authorized, name="not_authorized"),
# custom urls
re_path(r'^o/profile/?$', ProfileViewClass.as_view(), name="profile"),
re_path(r'^o/logout/?$', views.LogoutView.as_view(), name="remote_logout"),
re_path(r'^o/not_authorized/$', views.not_authorized, name="not_authorized"),

url(r'^o/restart_authorize/$', views.restart_authorize, name="restart_authorize"),
re_path(r'^o/restart_authorize/$', views.restart_authorize, name="restart_authorize"),

url('^accounts/', include('django.contrib.auth.urls')),
url(r'', views.index, name='index'),
path('accounts/', include('django.contrib.auth.urls')),
path('', views.index, name='index'),
]

0 comments on commit b392797

Please sign in to comment.