mirror of
https://github.com/plausible/analytics.git
synced 2024-12-23 17:44:43 +03:00
Add "Reset 2FA" action to users CRM
This commit is contained in:
parent
177cfc162b
commit
b2cd26b262
@ -54,6 +54,10 @@ defmodule Plausible.Auth.UserAdmin do
|
||||
lock: %{
|
||||
name: "Lock",
|
||||
action: fn _, user -> lock(user) end
|
||||
},
|
||||
reset_2fa: %{
|
||||
name: "Reset 2FA",
|
||||
action: fn _, user -> disable_2fa(user) end
|
||||
}
|
||||
]
|
||||
end
|
||||
@ -77,6 +81,10 @@ defmodule Plausible.Auth.UserAdmin do
|
||||
end
|
||||
end
|
||||
|
||||
def disable_2fa(user) do
|
||||
Plausible.Auth.TOTP.force_disable(user)
|
||||
end
|
||||
|
||||
defp grace_period_status(%{grace_period: grace_period}) do
|
||||
case grace_period do
|
||||
nil ->
|
||||
|
Loading…
Reference in New Issue
Block a user