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

should consume_otp! raise an exception? #146

Open
krtschmr opened this issue Jan 30, 2019 · 0 comments
Open

should consume_otp! raise an exception? #146

krtschmr opened this issue Jan 30, 2019 · 0 comments
Labels

Comments

@krtschmr
Copy link

rather than false maybe raise OTPAlreadyConsumed would be better?
In this case we could tell the user exactly why his login didn't worked.

example: user needs to whitelist his IP first via email confirmation link.
it's all possible to do that within 30 seconds (login, otp, confirm link). now if the OTP would be the same he would just get a login that wasn't performable because we won't capture this event.

https://github.com/tinfoil/devise-two-factor/blob/5549aba9f73827c1b8e925f10f6a518e5b10aaf4/lib/devise_two_factor/models/two_factor_authenticatable.rb#L66

@bsedat bsedat added the question label Jul 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants