mirror of
https://github.com/Tivix/django-rest-auth.git
synced 2024-12-02 05:43:44 +03:00
do token generation only when allauth_settings.EMAIL_VERIFICATION is not set to 'MANDATORY'
This commit is contained in:
parent
0b65b156e2
commit
7397ffd450
|
@ -69,10 +69,12 @@ class RegisterView(CreateAPIView):
|
|||
|
||||
def perform_create(self, serializer):
|
||||
user = serializer.save(self.request)
|
||||
if getattr(settings, 'REST_USE_JWT', False):
|
||||
self.access_token, self.refresh_token = jwt_encode(user)
|
||||
else:
|
||||
create_token(self.token_model, user, serializer)
|
||||
if allauth_settings.EMAIL_VERIFICATION != \
|
||||
allauth_settings.EmailVerificationMethod.MANDATORY:
|
||||
if getattr(settings, 'REST_USE_JWT', False):
|
||||
self.access_token, self.refresh_token = jwt_encode(user)
|
||||
else:
|
||||
create_token(self.token_model, user, serializer)
|
||||
|
||||
complete_signup(self.request._request, user,
|
||||
allauth_settings.EMAIL_VERIFICATION,
|
||||
|
|
Loading…
Reference in New Issue
Block a user