Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat:reset counter #70

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Kmjsatori-ssdr
Copy link

First of all, I have to mention that I'm a beginner at open-issue...

Related issue:#57

image

My thought

To implement the functionality of resetting a counter to zero and effectively prevent malicious resetting, I introduced an authorization mechanism. The detailed idea is as follows:

While it's easy to simply add a button to reset the counter to zero, the key challenge lies in effectively preventing malicious users from resetting others' counters. To address this, I have assigned a unique password to each counter name and added a password modification function.

For newly created counter names, the default password is set to an empty string. When users need to modify the password, if the name has never been assigned a password before, they can directly modify the password or reset the counter without entering the old password.

However, I'm not sure if this design is truly necessary, or if there might be a more reasonable design to solve this problem.

Result

image

Note: This pull request has modifies the database structure by introducing a new password field.

@Kmjsatori-ssdr
Copy link
Author

If there are any good suggestions, I am open to making further modifications..............

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant