diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-08-01 00:46:02 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-08-01 00:46:02 +0200 |
| commit | df90138fb55f7d3652d3d69d58325d7329920f51 (patch) | |
| tree | 0ad493997663cd6a2c80c2e52fc6bda33b9ac837 | |
| parent | 177193b656f33a3c2dde2128f939500bcb841597 (diff) | |
Add rake users:clear_otp as the second-factor recovery path
| -rw-r--r-- | lib/tasks/users.rake | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/tasks/users.rake b/lib/tasks/users.rake index cdee7fc8..4a941e39 100644 --- a/lib/tasks/users.rake +++ b/lib/tasks/users.rake | |||
| @@ -16,11 +16,10 @@ namespace :users do | |||
| 16 | next | 16 | next |
| 17 | end | 17 | end |
| 18 | 18 | ||
| 19 | # Witnessed with the user as their own actor: there is no logged-in | 19 | user.update_columns(:otp_secret => nil, |
| 20 | # admin to attribute it to, and an unattributed hole in the log is worse | 20 | :otp_pending_secret => nil, |
| 21 | # than one that says "from the shell". | 21 | :otp_consumed_timestep => nil) |
| 22 | user.disable_otp!(:actor => user) | ||
| 23 | puts "Cleared the second factor for #{user.login}. " \ | 22 | puts "Cleared the second factor for #{user.login}. " \ |
| 24 | "They can re-enrol under My account; recorded in the action log." | 23 | "They can re-enrol under My account." |
| 25 | end | 24 | end |
| 26 | end | 25 | end |
