Skip to content

Commit

Permalink
Merge pull request #39 from VolkerSchiewe/master
Browse files Browse the repository at this point in the history
Add token endpoints from rest_framework_simplejwt to url config
  • Loading branch information
iMerica committed Apr 17, 2020
2 parents 3b7b607 + 17e9230 commit 5d2e83c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions dj_rest_auth/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
PasswordResetConfirmView, PasswordResetView,
UserDetailsView)
from django.conf.urls import url
from django.conf import settings

urlpatterns = [
# URLs that do not require a session or valid token
Expand All @@ -16,3 +17,13 @@
url(r'^password/change/$', PasswordChangeView.as_view(),
name='rest_password_change'),
]

if getattr(settings, 'REST_USE_JWT', False):
from rest_framework_simplejwt.views import (
TokenRefreshView, TokenVerifyView,
)

urlpatterns += [
url(r'^token/verify/$', TokenVerifyView.as_view(), name='token_verify'),
url(r'^token/refresh/$', TokenRefreshView.as_view(), name='token_refresh'),
]

0 comments on commit 5d2e83c

Please sign in to comment.