mirror of
https://github.com/plausible/analytics.git
synced 2024-12-24 01:54:34 +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: %{
|
lock: %{
|
||||||
name: "Lock",
|
name: "Lock",
|
||||||
action: fn _, user -> lock(user) end
|
action: fn _, user -> lock(user) end
|
||||||
|
},
|
||||||
|
reset_2fa: %{
|
||||||
|
name: "Reset 2FA",
|
||||||
|
action: fn _, user -> disable_2fa(user) end
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
end
|
end
|
||||||
@ -77,6 +81,10 @@ defmodule Plausible.Auth.UserAdmin do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def disable_2fa(user) do
|
||||||
|
Plausible.Auth.TOTP.force_disable(user)
|
||||||
|
end
|
||||||
|
|
||||||
defp grace_period_status(%{grace_period: grace_period}) do
|
defp grace_period_status(%{grace_period: grace_period}) do
|
||||||
case grace_period do
|
case grace_period do
|
||||||
nil ->
|
nil ->
|
||||||
|
Loading…
Reference in New Issue
Block a user