From 19290ed9a23ae398b843ded3096ff867fd91747e Mon Sep 17 00:00:00 2001 From: emile Date: Fri, 5 Apr 2024 22:36:07 +0300 Subject: [PATCH] sas --- osinaweb/osinacore/api/views.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/osinaweb/osinacore/api/views.py b/osinaweb/osinacore/api/views.py index aaca4912..8e1cf3a3 100644 --- a/osinaweb/osinacore/api/views.py +++ b/osinaweb/osinacore/api/views.py @@ -31,22 +31,16 @@ def register_customer(request): def authenticate_customer(request): if request.method == 'POST': email = request.POST.get('email') - password = request.POST.get('password') - # Check if user with provided email exists try: user = User.objects.get(email=email) except User.DoesNotExist: return JsonResponse({'success': False, 'error': 'User with this email does not exist'}) - # Perform authentication - user = authenticate(request, email=email, password=password) + user = authenticate(request, email=email) - # Check authentication result if user is not None: - # Authentication successful login(request, user) return JsonResponse({'success': True}) else: - # Authentication failed due to invalid password - return JsonResponse({'success': False, 'error': 'Invalid password'}) \ No newline at end of file + return JsonResponse({'success': False, 'error': 'Authentication failed'})