by benmmurphy · 3y ago · 0 comments
if you are worried about timing attacks then you can just have your routes in the form of `/user/<id>/reset_password/<token>` and pull the user out of the DB and then do the comparison using a timing safe function. alternatively, if that is not possible and you need to do a lookup by the token its possible to blind the value stored in the DB but i would avoid that because it introduces another cryptographic primitive unnecessarily. and having only index on user_id and not having to have indexes on all your tokens saves space as well!