Skip to content

Commit

Permalink
fix: fix nafath backend flow (#437)
Browse files Browse the repository at this point in the history
Co-authored-by: Muhammad Faraz  Maqsood <[email protected]>
  • Loading branch information
Faraz32123 and Muhammad Faraz Maqsood authored Oct 26, 2023
1 parent 5434ed3 commit 5017110
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions openedx/core/djangoapps/user_authn/views/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def _get_user_by_email_or_username(request, api_version):
login_fields = ['email', 'password']
if is_api_v2:
login_fields = ['email_or_username', 'password']
if request.POST.get('is_nafath_user', False):
if request.POST.get('is_nafath_user', False) and request.POST.get('trans_id', ""):
login_fields.remove('password')

if any(f not in request.POST.keys() for f in login_fields):
Expand Down Expand Up @@ -241,7 +241,7 @@ def _authenticate_first_party(request, unauthenticated_user, third_party_auth_re
if not third_party_auth_requested:
_check_user_auth_flow(request.site, unauthenticated_user)

if request.POST.get('is_nafath_user', False):
if request.POST.get('is_nafath_user', False) and request.POST.get('trans_id', ""):
return authenticate(
username=username,
request=request
Expand Down

0 comments on commit 5017110

Please sign in to comment.