Open
Conversation
90d433b to
203cb7d
Compare
rafaelurben
reviewed
Sep 3, 2024
| key.save(update_fields=["enabled"]) | ||
| return HttpResponse("OK") | ||
| return HttpResponse("Error: You own this token so you can't toggle it", status=403) | ||
| return HttpResponseForbidden("Error: You own this token so you can't toggle it") |
There was a problem hiding this comment.
I think this should be "You don't own [...]".
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
passkey/views.py.django-passkeys/passkeys/views.py
Lines 15 to 19 in abb687b
I think there is a risk that Passkey ID on database will be leaked.
If you are checking user matches, I think it would be a good idea to retrieve it as a query and set it as Not Found.
django-passkeys/passkeys/views.py
Line 23 in abb687b
idis reserved as a built-in function.django-passkeys/passkeys/views.py
Lines 24 to 27 in abb687b
This code generates the query twice.
Also, here we only have one matching data, so we can improve it by using
first().django-passkeys/passkeys/views.py
Line 30 in abb687b
django.http.responseprovidesHttpResponseForbiddenand the status is set to 403.