Skip to content

Add two-factor authentication: settings and enrollment - #112

Closed
antopalidi wants to merge 4 commits into
developfrom
feature/two-factor-setup
Closed

antopalidi wants to merge 4 commits into
developfrom
feature/two-factor-setup

Conversation

@antopalidi

Copy link
Copy Markdown
Member

🎩 What? Why?

Participants have no way to protect their account beyond the password. This PR adds two-factor authentication (2FA): a page in the account where participants attach an authenticator app or the email code, with recovery codes, and a switch in the system panel to enable it per organization (off by default).

Please note: it is the first of three PRs. The next one asks for the code at sign in and confirms the account access before changing the factors; the last one adds enforcement for admins or everyone and passkeys. The migrations already cover all three.

📌 Related Issues

Link your PR to an issue

  • Related to #?
  • Fixes #?

Testing

  1. In /system, edit the organization, check "Enable two-factor authentication" and save.
  2. Log in as a participant and open "Two-factor authentication" in the profile menu.
  3. Click "Add authenticator app", scan the QR code, enter the code from the app.
  4. See the recovery codes, click "I have saved the codes".
  5. See the authenticator app listed, remove it, see the recovery codes gone too.
  6. Enable the email code the same way.
  7. Run EMAIL=<email> HOST=<host> bin/rails decidim:two_factor:reset and see the factors removed and the email sent.

📷 Screenshots

System panel
Add authenticator app
Recovery codes
Account page

♥️ Thank you!

@coderabbitai

coderabbitai Bot commented Sep 14, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@antopalidi antopalidi closed this Sep 16, 2026
microstudi pushed a commit that referenced this pull request Sep 18, 2026
* Add two-factor authentication: settings and enrollment

(cherry picked from commit 32092fb)

* locale normalize

(cherry picked from commit 6c4cc62)

* fix stylelint

(cherry picked from commit a7be721)

* Fix method filtering, lock enrollment and update the generators lock file

(cherry picked from commit 74741db)

* fix linter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant