Skip to content

Two-factor Authentication send a code not working #690

@anthonycrumley

Description

@anthonycrumley

Describe the bug
The Two-factor Authentication plugin we are using has a link to send a code to the user rather than using a code from the Google Authenticator App. This link gets an error because we did not implement the method for sending the code. The plugin then stores a code on the user that they must use to log in, even though it was not actually sent to them. At this point, the user can no longer log in using the Google Authenticator App.

To Reproduce
Steps to reproduce the behavior:

  1. Log in with a user that has Two-factor Authentication enabled. This is enabled from the user's Edit Profile page.
  2. Click the "Send me a code instead" link.
  3. See error page.
  4. Use the back button to go back to the Two-factor Authentication page and see that you can no longer use the Google Authenticator App.

Expected behavior
A code should be emailed to the user to verify their Two-factor Authentication.

Screenshots
sendacode
sendcodeerror
sentcode

Additional context

def send_two_factor_authentication_code(code)
  # Send code via SMS, Email, etc.
end
  • Rails email guide: https://guides.rubyonrails.org/action_mailer_basics.html
  • Once you have logged in with Two-factor Authentication (TFA), a cookie is stored that will cause the app to not ask for a code for a month. The go through the TFA process again the cookie will need to be deleted. The cookie name is remember_tfa.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions