Skip to content
Open
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
10 changes: 10 additions & 0 deletions openedx/core/djangoapps/user_authn/views/password_reset.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,16 @@ def password_reset(request):
Attempts to send a password reset e-mail.
"""
user = request.user
profile = EdlyUserProfile.objects.filter(user=user).first()
if profile and profile.is_social_user:
return JsonResponse(
{
'success': False,
'value': _("This account uses social login; password reset isn't available.")
},
status=400
)

# Prefer logged-in user's email
email = user.email if user.is_authenticated else request.POST.get('email')
AUDIT_LOG.info("Password reset initiated for email %s.", email)
Expand Down