Browse Source

HOT-FIX: Ativa login via api com TokenAuthentication

pull/3519/head
Leandro Roberto 3 years ago
parent
commit
6c0ea8a48f
  1. 4
      sapl/api/urls.py

4
sapl/api/urls.py

@ -2,6 +2,7 @@
from django.conf.urls import include, url
from drf_spectacular.views import SpectacularAPIView, SpectacularSwaggerView, \
SpectacularRedocView
from rest_framework.authtoken.views import obtain_auth_token
from rest_framework.routers import DefaultRouter
from sapl.api.deprecated import MateriaLegislativaViewSet, SessaoPlenariaViewSet, \
@ -12,6 +13,7 @@ from sapl.api.viewset import SaplApiViewSetConstrutor
from .apps import AppConfig
app_name = AppConfig.name
router = DefaultRouter()
@ -53,6 +55,8 @@ urlpatterns = [
url(r'^api/version', AppVersionView.as_view()),
url(r'^api/recriar-token/(?P<pk>\d*)$', recria_token, name="recria_token"),
url(r'^api/auth/token$', obtain_auth_token),
# implementar caminho para autenticação
# https://www.django-rest-framework.org/tutorial/4-authentication-and-permissions/
# url(r'^api/auth/', include('rest_framework.urls', namespace='rest_framework')),

Loading…
Cancel
Save