From 6c0ea8a48fe1026a2d5c4508d466ae93796c9750 Mon Sep 17 00:00:00 2001 From: Leandro Roberto Date: Mon, 7 Mar 2022 15:32:09 -0300 Subject: [PATCH] HOT-FIX: Ativa login via api com TokenAuthentication --- sapl/api/urls.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sapl/api/urls.py b/sapl/api/urls.py index 1dfea3901..ddfa93df4 100644 --- a/sapl/api/urls.py +++ b/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\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')),