mkalioby / django-passkeys

Django Authentication Backend For Passkeys
MIT License
197 stars 21 forks source link

Only retrieve keys for the right user for deletion #9

Closed ashokdelphia closed 1 year ago

ashokdelphia commented 1 year ago

I think this is preferable to retrieving the record and then checking the user.

If the user passes a bad id (either non-existent, or someone else's), then the get here is going to throw a DoesNotExist. I think that's no worse than the current behaviour, but at some point it likely makes sense to handle that case explicitly, and serve a real error.

(Note also that the logic in the deleted error message is backwards.)

ashokdelphia commented 1 year ago

I'll re-make this once I have the tests running locally, and cover the toggle case, too.