Solution for How to make a unresettable timer
is Given Below:
I have a timer from this answer: https://ru.codeutlity.org/questions/904035/%D0%9E%D0%B1%D1%80%D0%B0%D1%82%D0%BD%D1%8B%D0%B9-%D1%81%D1%87%D1%91%D1%82%D1%87%D0%B8%D0%BA-%D0%BD%D0%B0-vue-js
But the problem is you can reset it when reloading a page. And I need it to be unresettable.
I implemented an authorization using tokens and inserting expiring time in database before and thinking about doing something similar here. Is it a good idea when user opens a page with timer to insert “current time + 30 seconds” in DB, return it to frontend, insert into browser’s localStorage and calculate timer’s value by doing “localStorageTime – current time” using intervals (and if user somehow manages to click retry button before timer is 0 it won’t return anything because backend’s “current time” is not bigger than this timer’s time of self-destruction)? Or are there better solutions?