feat(admin): allow admins to confirm users and set passwords#834
feat(admin): allow admins to confirm users and set passwords#834rewritten wants to merge 2 commits intocoopdevs:developfrom
Conversation
Admins can now create users that are already confirmed (bypassing email confirmation) and optionally set a password at creation time. Existing unconfirmed users can be confirmed via a dedicated action button on their show page. Confirmed-at timestamp is also shown in the user index. Closes coopdevs#821 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds admin-side controls to confirm users and optionally set passwords at creation time, reducing reliance on SMTP for provisioning accounts (Issue #821).
Changes:
- Adds an admin “Confirm user” action and shows
confirmed_atin the admin users index. - Extends the ActiveAdmin user form to optionally set password/password confirmation and “Confirm immediately” on create.
- Updates all locales with new i18n keys for the added admin UI.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| config/locales/pt-BR.yml | Adds i18n keys for confirm actions and “confirm immediately”. |
| config/locales/ja.yml | Adds i18n keys for confirm actions and “confirm immediately”. |
| config/locales/gl.yml | Adds i18n keys for confirm actions and “confirm immediately”. |
| config/locales/fr.yml | Adds i18n keys for confirm actions and “confirm immediately”. |
| config/locales/eu.yml | Adds i18n keys for confirm actions and “confirm immediately”. |
| config/locales/es.yml | Adds i18n keys for confirm actions and “confirm immediately”. |
| config/locales/en.yml | Adds i18n keys for confirm actions and “confirm immediately”. |
| config/locales/ca.yml | Adds i18n keys for confirm actions and “confirm immediately”. |
| app/models/user.rb | Introduces confirm_immediately virtual attribute used during admin create. |
| app/admin/user.rb | Adds confirm member action, confirmed_at column, password fields, and create/update overrides for confirmation/password handling. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| member_action :confirm, method: :put do | ||
| resource.confirm! | ||
| redirect_to admin_user_path(resource), notice: I18n.t("active_admin.users.confirmed_notice") | ||
| end |
There was a problem hiding this comment.
New admin behaviors are introduced here (manual confirmation endpoint and the ability to set/retain passwords via the ActiveAdmin form/controller overrides) but there are no specs covering them. Adding request/controller specs around PUT /admin/users/:id/confirm, create with/without confirm_immediately, and update with blank vs non-blank password would help prevent regressions (especially around Devise confirmable).
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Summary
Closes #821
Password/Password confirmationfields and aConfirm immediatelycheckbox — when checked, the user is created already confirmed without needing a working SMTP setupPUT /admin/users/:id/confirmactionconfirmed_atcolumn so confirmation status is visible at a glanceTest plan
confirmed_atshould be set, no confirmation email requiredconfirmed_atshould be set and the button should disappear🤖 Generated with Claude Code