heroku / heroku-two-factor

Deprecated - see our updated docs.
https://devcenter.heroku.com/articles/two-factor-authentication
4 stars 3 forks source link

Rich error text on invalid two-factor code #40

Closed brandur closed 10 years ago

brandur commented 10 years ago

Present users with a more helpful error when an invalid 2FA code is detected.

$ heroku login
Enter your Heroku credentials.
Email: brandur@heroku.com
Password (typing will be hidden):
Two-factor code: wef
Authentication failed due to an invalid two-factor code. Please check
your code was typed correctly and that your authenticator's time is
accurate.

Requires heroku/api#2165 to be in production to properly function.

Fixes #27.

friism commented 10 years ago

Yeah!

I've also seen errors asking to check for timezone settings, is that relevant?

brandur commented 10 years ago

@friism Holy, I'd really hope that this system uses UTC. The gem we're using server-side does at least, so I'm assuming Google authenticator is as well.

pedro commented 10 years ago

It's not exactly about timezones, but just asking users to double check their clocks (and force a ntp sync where possible). We've seen at least one Herokai having issues with this.

brandur commented 10 years ago

Pulling this in. Feel free to send a pull to amend the error text above!