Disable auth for login and registration end-points
This commit is contained in:
@@ -50,6 +50,10 @@ class ApiKeyHeaderPermission(permissions.BasePermission):
|
||||
class LoginSessionView(APIView):
|
||||
"""HTTP end-points for logging in users. """
|
||||
|
||||
# This end-point is available to anonymous users,
|
||||
# so do not require authentication.
|
||||
authentication_classes = []
|
||||
|
||||
def get(self, request):
|
||||
"""Return a description of the login form.
|
||||
|
||||
@@ -143,6 +147,10 @@ class RegistrationView(APIView):
|
||||
"honor_code", "terms_of_service",
|
||||
]
|
||||
|
||||
# This end-point is available to anonymous users,
|
||||
# so do not require authentication.
|
||||
authentication_classes = []
|
||||
|
||||
def _is_field_visible(self, field_name):
|
||||
"""Check whether a field is visible based on Django settings. """
|
||||
return self._extra_fields_setting.get(field_name) in ["required", "optional"]
|
||||
|
||||
Reference in New Issue
Block a user