Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix nafath backend flow #437

Merged
merged 1 commit into from
Oct 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading