Skip to content

Commit

Permalink
Don't persist an auth_token that fails validation.
Browse files Browse the repository at this point in the history
  • Loading branch information
rtibbles committed Nov 4, 2024
1 parent bffa4dd commit b12fee4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions kolibri/plugins/app/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ def get(self, request, token):
user = FacilityUser.objects.get_or_create_os_user(auth_token)
if user is not None:
login(request, user)
else:
# If the user is not found, then we should not persist the auth_token
auth_token = None
except ValidationError as e:
logger.error(e)
redirect_url = request.GET.get("next", "/")
Expand Down

0 comments on commit b12fee4

Please sign in to comment.