sec51 / twofactor

Golang two factor authentication library
ISC License
217 stars 66 forks source link

Made step size a parameter of NewTOTP #13

Closed MarkSonghurst closed 6 years ago

MarkSonghurst commented 6 years ago

During end-to-end testing it is sometimes necessary to increase (or decrease) the step size value to allow external scripts or busy humans to react. Also some users might require a longer period of time, particularly those with accessibility issues. This PR adds a step parameter into NewTOTP, which will default to 30 seconds if not sensible (test case included). This is an API breaking change.