fix: email magic sign in integrity error (#1662)

This commit is contained in:
Nikhil 2023-07-25 14:23:26 +05:30 committed by GitHub
parent 3ad3cc77f9
commit 7763cca9a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -279,6 +279,8 @@ class MagicSignInGenerateEndpoint(BaseAPIView):
status=status.HTTP_400_BAD_REQUEST,
)
# Clean up
email = email.strip().lower()
validate_email(email)
## Generate a random token
@ -346,7 +348,7 @@ class MagicSignInEndpoint(BaseAPIView):
def post(self, request):
try:
user_token = request.data.get("token", "").strip()
key = request.data.get("key", False)
key = request.data.get("key", False).strip().lower()
if not key or user_token == "":
return Response(