Skip to content

Commit

Permalink
Enable SessionAuthentication on APIv3 endpoints
Browse files Browse the repository at this point in the history
This is required to be able to use the APIv3 from the dashboard in the new
templates we are creating.
  • Loading branch information
humitos committed Jul 15, 2020
1 parent 4967925 commit f00a62b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions readthedocs/api/v3/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from django.utils.safestring import mark_safe
from rest_flex_fields.views import FlexFieldsMixin
from rest_framework import status
from rest_framework.authentication import TokenAuthentication
from rest_framework.authentication import SessionAuthentication, TokenAuthentication
from rest_framework.decorators import action
from rest_framework.metadata import SimpleMetadata
from rest_framework.mixins import (
Expand Down Expand Up @@ -61,9 +61,7 @@ class APIv3Settings:
``DEFAULT_THROTTLE_RATES`` since it's not possible to define here.
"""

# Using only ``TokenAuthentication`` for now, so we can give access to
# specific carefully selected users only
authentication_classes = (TokenAuthentication,)
authentication_classes = (TokenAuthentication, SessionAuthentication)
permission_classes = (PublicDetailPrivateListing,)

pagination_class = LimitOffsetPagination
Expand Down

0 comments on commit f00a62b

Please sign in to comment.