Answer the question
In order to leave comments, you need to log in
How to limit the ability to click on a button to one time?
Hello. I am making a page of my portfolio, where a preview of projects will be shown, a description will be shown and on each there will be a like button and a number of likes next to it. In the project I use vue(vuex,vue-router,vue-resource) and firebase. Previews are shown using v-for, the data is stored in json, in firebase. So, in the same Jason I store the number of likes, which is naturally incremented when clicked and sent to the firebase. Question: how to limit the number of clicks on the button to one time? Authentication is not and never will be. In my junior mind, there is no ideal solution without using authentication. By IP is not an option, because there can be one external IP in some networks, correct me if I'm wrong.
Only local storage comes to mind, although it is clear that you can open another browser or incognito. Or, instead of authentication, allow likes only after entering email. It is unlikely that someone will want to enter some characters 10 times in order to put me a free firebase account.
What options?
Thanks
Answer the question
In order to leave comments, you need to log in
On the first click, removeEventListener and disabled on the button.
Of course, this will not prevent an attacker from sending hundreds of likes directly from the browser console.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question