rtn/totp
12
6
Fork
You've already forked totp
3

Improve validation on period and digits #12

Merged
rtn merged 2 commits from better-validation into main 2025年01月20日 11:16:42 +01:00
Owner
Copy link

Fixes #1 and #2

Fixes #1 and #2
rtn force-pushed better-validation from 0f01ef58f7 to 2022f0d2ae 2025年01月20日 11:03:40 +01:00 Compare
app.js Outdated
@ -294,2 +308,2 @@
account.period = Number(params.get('period'))
if (isNaN(account.period) || account.period <= 0) {
const period = account.period = Number(params.get('period'))
if (!isWholeNumber(period) || !inRange(period, 20, 120)) {
Author
Owner
Copy link

I picked an interval of 20s to 120s for the refresh time. I more or less picked them out of a hat. The default time period is 30s and it doesn't make sense to have it too short, nor too large. If it's too short, then you don't have time to use it before there's a new one generated. And if it's too large then it defeats the purpose altogether (approaching a static password as time increases).

I picked an interval of 20s to 120s for the refresh time. I more or less picked them out of a hat. The default time period is 30s and it doesn't make sense to have it too short, nor too large. If it's too short, then you don't have time to use it before there's a new one generated. And if it's too large then it defeats the purpose altogether (approaching a static password as time increases).
rtn deleted branch better-validation 2025年01月20日 11:16:49 +01:00
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
rtn/totp!12
Reference in a new issue
rtn/totp
No description provided.
Delete branch "better-validation"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?