Skip to content

Commit

Permalink
Add more detailed error statuses
Browse files Browse the repository at this point in the history
  • Loading branch information
frostyfan109 committed May 28, 2024
1 parent e85828f commit 2b3fc55
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions appstore/core/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,14 @@ def auth_identity(request):
try:
token = UserIdentityToken.objects.get(token=raw_token)
if not token.valid:
return HttpResponse()
return HttpResponse("The token is expired. Try restarting the app.", status=401)
remote_user = token.user.get_username()
response = HttpResponse(remote_user, status=200)
response["REMOTE_USER"] = remote_user
response["ACCESS_TOKEN"] = token.token
return response
except UserIdentityToken.DoesNotExist:
return HttpResponse("The token does not exist", status=401)
return HttpResponse("The token does not exist. Try restarting the app.", status=401)


@login_required
Expand Down

0 comments on commit 2b3fc55

Please sign in to comment.