fix: email magic sign in integrity error (#1662)
This commit is contained in:
parent
3ad3cc77f9
commit
7763cca9a2
1 changed files with 3 additions and 1 deletions
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue