Disable auth for login and registration end-points

This commit is contained in:
Will Daly
2014-10-23 10:18:52 -04:00
parent d8eafc4754
commit fb5a8098de
2 changed files with 24 additions and 0 deletions

View File

@@ -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"]