mirror of
https://github.com/makeplane/plane.git
synced 2026-01-25 23:59:24 -06:00
fix: email error handling on magic auth
This commit is contained in:
@@ -44,10 +44,8 @@ class MagicGenerateEndpoint(APIView):
|
||||
return Response(exc.get_error_dict(), status=status.HTTP_400_BAD_REQUEST)
|
||||
|
||||
origin = request.META.get("HTTP_ORIGIN", "/")
|
||||
email = request.data.get("email", False)
|
||||
email = request.data.get("email", "").strip().lower()
|
||||
try:
|
||||
# Clean up the email
|
||||
email = email.strip().lower()
|
||||
validate_email(email)
|
||||
adapter = MagicCodeProvider(request=request, key=email)
|
||||
key, token = adapter.initiate()
|
||||
|
||||
@@ -39,10 +39,8 @@ class MagicGenerateSpaceEndpoint(APIView):
|
||||
return Response(exc.get_error_dict(), status=status.HTTP_400_BAD_REQUEST)
|
||||
|
||||
origin = base_host(request=request, is_space=True)
|
||||
email = request.data.get("email", False)
|
||||
email = request.data.get("email", "").strip().lower()
|
||||
try:
|
||||
# Clean up the email
|
||||
email = email.strip().lower()
|
||||
validate_email(email)
|
||||
adapter = MagicCodeProvider(request=request, key=email)
|
||||
key, token = adapter.initiate()
|
||||
|
||||
Reference in New Issue
Block a user