Core: add jwt auth
This commit is contained in:
parent
1e0ffd9b2d
commit
495312b060
12 changed files with 234 additions and 17 deletions
20
jwtauth/urls.py
Normal file
20
jwtauth/urls.py
Normal file
|
@ -0,0 +1,20 @@
|
|||
from django.urls import path
|
||||
|
||||
from rest_framework_simplejwt.views import (
|
||||
TokenObtainPairView,
|
||||
TokenRefreshView,
|
||||
TokenVerifyView,
|
||||
)
|
||||
|
||||
from .views import *
|
||||
|
||||
urlpatterns = [
|
||||
#to do: costumize this!
|
||||
path('register/', register_service, name='register_service'),
|
||||
#post username and password, get access and refresh token
|
||||
path('', TokenObtainPairView.as_view(), name='token_obtain_pair'),
|
||||
#post refresh token to this url to get a new access token
|
||||
path('refresh/', TokenRefreshView.as_view(), name='token_refresh'),
|
||||
#validates the access token
|
||||
path('verify/', TokenVerifyView.as_view(), name='token_verify'),
|
||||
]
|
Loading…
Add table
Add a link
Reference in a new issue