зеркало из https://github.com/nextcloud/appstore.git
initial token auth support
- token auth support in the API views. - create a when a local user signs up.
This commit is contained in:
Родитель
15f838c15d
Коммит
887aefb59a
|
@ -55,7 +55,7 @@ class Categories(ListAPIView):
|
|||
|
||||
|
||||
class Apps(DestroyAPIView):
|
||||
authentication_classes = (authentication.BasicAuthentication,)
|
||||
authentication_classes = (authentication.TokenAuthentication, authentication.BasicAuthentication,)
|
||||
permission_classes = (UpdateDeletePermission,)
|
||||
serializer_class = AppSerializer
|
||||
queryset = App.objects.all()
|
||||
|
@ -78,7 +78,7 @@ class Apps(DestroyAPIView):
|
|||
|
||||
|
||||
class AppReleases(DestroyAPIView):
|
||||
authentication_classes = (authentication.BasicAuthentication,)
|
||||
authentication_classes = (authentication.TokenAuthentication, authentication.BasicAuthentication,)
|
||||
permission_classes = (UpdateDeletePermission, IsAuthenticated)
|
||||
throttle_classes = (PostThrottle,)
|
||||
throttle_scope = 'app_upload'
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
from django import forms
|
||||
|
||||
from captcha.fields import ReCaptchaField
|
||||
|
||||
from rest_framework.authtoken.models import Token
|
||||
|
||||
class SignupFormRecaptcha(forms.Form):
|
||||
"""integrate a recaptcha field."""
|
||||
recaptcha = ReCaptchaField()
|
||||
|
||||
def signup(self, request, user):
|
||||
pass
|
||||
t = Token.objects.create(user=user)
|
||||
t.save()
|
||||
|
|
|
@ -27,6 +27,7 @@ INSTALLED_APPS = [
|
|||
'parler',
|
||||
'captcha',
|
||||
'rest_framework',
|
||||
'rest_framework.authtoken',
|
||||
'corsheaders',
|
||||
'allauth',
|
||||
'allauth.account',
|
||||
|
|
Загрузка…
Ссылка в новой задаче