wmlele/devise-otp

NoMethodError (undefined method `scan' for nil:NilClass) when no token supplied on check

Closed this issue · 2 comments

After enabling 2FA, if you try to authenticate through it but don't supply a password you will get a 500 instead of an error message.

To be more helpful, it is because on line 124 of the model it checks against the token without confirming its not nil. So we just need to throw a flash error if token is nil.

Issued pull request with a fix.