mirror of
https://github.com/Tivix/django-rest-auth.git
synced 2024-12-02 13:53:43 +03:00
Merge pull request #111 from mohmyo/master
Do token generation only when EMAIL_VERIFICATION is not set to 'MANDATORY'
This commit is contained in:
commit
1ffcbfe6a8
|
@ -69,6 +69,8 @@ class RegisterView(CreateAPIView):
|
||||||
|
|
||||||
def perform_create(self, serializer):
|
def perform_create(self, serializer):
|
||||||
user = serializer.save(self.request)
|
user = serializer.save(self.request)
|
||||||
|
if allauth_settings.EMAIL_VERIFICATION != \
|
||||||
|
allauth_settings.EmailVerificationMethod.MANDATORY:
|
||||||
if getattr(settings, 'REST_USE_JWT', False):
|
if getattr(settings, 'REST_USE_JWT', False):
|
||||||
self.access_token, self.refresh_token = jwt_encode(user)
|
self.access_token, self.refresh_token = jwt_encode(user)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user