|
@@ -1,4 +1,5 @@
|
|
import base64
|
|
import base64
|
|
|
|
+from datetime import datetime, timezone
|
|
from ipaddress import ip_address
|
|
from ipaddress import ip_address
|
|
|
|
|
|
from django.contrib.auth.hashers import PBKDF2PasswordHasher
|
|
from django.contrib.auth.hashers import PBKDF2PasswordHasher
|
|
@@ -160,6 +161,10 @@ class AuthenticatedBasicUserActionAuthentication(BaseAuthentication):
|
|
serializer.is_valid(raise_exception=True)
|
|
serializer.is_valid(raise_exception=True)
|
|
user = serializer.validated_data['user']
|
|
user = serializer.validated_data['user']
|
|
|
|
|
|
|
|
+ email_verified = datetime.fromtimestamp(serializer.timestamp, timezone.utc)
|
|
|
|
+ user.email_verified = max(user.email_verified or email_verified, email_verified)
|
|
|
|
+ user.save()
|
|
|
|
+
|
|
# When user.is_active is None, activation is pending. We need to admit them to finish activation, so only
|
|
# When user.is_active is None, activation is pending. We need to admit them to finish activation, so only
|
|
# reject strictly False. There are permissions to make sure that such accounts can't do anything else.
|
|
# reject strictly False. There are permissions to make sure that such accounts can't do anything else.
|
|
if user.is_active == False:
|
|
if user.is_active == False:
|