Skip to content

Commit 4a8b24a

Browse files
committed
add rake scripts instead of running the runner
1 parent 0f0a4b1 commit 4a8b24a

File tree

1 file changed

+8
-26
lines changed

1 file changed

+8
-26
lines changed

self-hosted/configuration/multi-factor-authentication.mdx

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -120,16 +120,14 @@ If a user loses access to their authenticator:
120120

121121
2. **Admin intervention** (if backup codes are also lost):
122122
```bash
123-
# Disable MFA for a specific user
124-
rails runner "
125-
user = User.find_by(email: 'user@example.com')
126-
user.update!(
127-
otp_required_for_login: false,
128-
otp_secret: nil,
129-
otp_backup_codes: nil
130-
)
131-
puts 'MFA disabled for ' + user.email
132-
"
123+
# Reset MFA for a specific user
124+
rake mfa:reset[user@example.com]
125+
126+
# Generate new backup codes for a user
127+
rake mfa:generate_backup_codes[user@example.com]
128+
129+
# Reset MFA for all users
130+
rake mfa:reset_all
133131
```
134132

135133
## Security Best Practices
@@ -166,22 +164,6 @@ rails runner "
166164
If encryption keys are lost:
167165
1. All users will need to re-enable MFA
168166
2. Communicate the issue to users promptly
169-
3. Consider temporary alternative authentication methods
170-
171-
### Rolling Back MFA
172167

173-
To completely disable MFA for all users:
174-
175-
```bash
176-
# Disable MFA for all users
177-
rails runner "
178-
User.update_all(
179-
otp_required_for_login: false,
180-
otp_secret: nil,
181-
otp_backup_codes: nil
182-
)
183-
puts 'MFA disabled for all users'
184-
"
185-
```
186168

187169
*This guide applies to Chatwoot version 4.6 and above*

0 commit comments

Comments
 (0)